This will be called after successfull signin
975631
def sign_in_success
      g_user = signed_in?

      if g_user
        user = {
          :email => g_user.email,
          :user_id => g_user.user_id,
          :name => g_user.name,
          :photo_url => g_user.photo_url,
          :provider_id => g_user.provider_id
        }

        @user = User.find_by(user_id: user[:user_id])

        if @user.nil?
          @user = User.create user
        else
          @user.update user
        end

        session[:user] = @user.id

        if session[:previous_url]
          previous_url = session[:previous_url]
          session.delete :previous_url
          redirect_to previous_url
        else
          redirect_to main_app.root_url
        end
      else
        @user = false
        session.delete :user

        flash.alert = "Sign in failed. Please try again."
        redirect_to gitkit_sign_in_url
      end
    end
397717
function SignResultPacket(total, witness, script) {
  Packet.call(this);
  this.total = total || 0;
  this.script = script || [];
  this.witness = witness || [];
}
153870
def on_connect(self, client, userdata, flags, result_code):
        
        self.log_info("Connected with result code {}".format(result_code))
        self.state_handler.set_state(State.welcome)
15675
function onApplyActionCode() {
  var code = $('#email-verification-code').val();
  auth.applyActionCode(code).then(function() {
    alertSuccess('Email successfully verified!');
    refreshUserData();
  }, onAuthError);
}
421222
async function () {
    const oThis = this;

    // Validate new branded token
    logger.step("** Validating branded token");
    await oThis._validateBrandedTokenDetails();

    // Generate reserve address
    logger.step("** Generating reserve address");
    var addressRes = await oThis._generateAddress();
    oThis.reserveAddress = addressRes.data.address;
    logger.info("* address:", oThis.reserveAddress);

    // Start the BT proposal
    var proposeRes = await oThis._propose();

    // Monitor the BT proposal response
    var statusRes = await oThis._checkProposeStatus(proposeRes.data.transaction_hash);
    var registrationStatus = statusRes.data.registration_status;
    oThis.uuid = registrationStatus['uuid'];
    oThis.erc20 = registrationStatus['erc20_address'];

    // Add branded token to config file
    logger.step("** Updating branded token config file");
    await oThis._updateBrandedTokenConfig();

    // Allocating shard for storage of token balances
    logger.step("** Allocating shard for storage of token balances");
    await oThis._allocateShard();

    process.exit(0);

  }
1187510
function postAuthLogout(req, res) {
    if (authMaintenance.usingSessions) {
      req.logout();
    }
    res.status(200).send('Ok');
  }
1276458
public function afterRegistry()
    {
        $this->_select = $this->db->select();
        $this->_select->from('gems__appointments', $this->fields);
    }
837264
function signup(){
    console.log('signup called');

    var name = document.getElementById('signup-name').value;
    var username = document.getElementById('signup-username').value;
    var email = document.getElementById('signup-email').value;
    var password = document.getElementById('signup-password').value;

    grout.signup().then(function(){
      console.log('successful logout');
      setStatus();
    }, function(err){
      console.error('logout() : Error logging out:', err);
    });
  }
589427
function signInOrLinkCredential(credential) {
  if (currentTab == '#user-section') {
    if (!activeUser()) {
      alertError('You need to sign in before linking an account.');
      return;
    }
    activeUser().linkWithCredential(credential)
        .then(function(result) {
          logAdditionalUserInfo(result);
          refreshUserData();
          alertSuccess('Provider linked!');
        }, onAuthError);
  } else {
    auth.signInWithCredential(credential)
        .then(onAuthUserCredentialSuccess, onAuthError);
  }
}
14515
function(req, res) {

      req.session.authenticated = false;

      var defaultString = 'You have successfully logged out.';

      // now respond or redirect
      var postResponse = this._resolvePostAction(waterlock.config.postActions.logout.success,
        defaultString);

      if (typeof postResponse === 'string' && this._isURI(postResponse)) {
        res.redirect(postResponse);
      } else {
        res.ok(postResponse);
      }
    }
746199
public function afterMemberLoggedIn()
    {
        // Clear the incorrect log-in count
        $this->registerSuccessfulLogin();

        $this->LockedOutUntil = null;

        $this->regenerateTempID();

        $this->write();

        // Audit logging hook
        $this->extend('afterMemberLoggedIn');
    }
452666
def finish_user(self, subid):
    ''''''        

    p = self.revoke_token(subid)
    p.token = "finished"
    self.session.commit()
    return p
1319235
function SignInputResultPacket(value, witness, script) {
  Packet.call(this);
  this.value = value || false;
  this.script = script || null;
  this.witness = witness || null;
}
1148378
private void afterLogin(GwtCommand command, Deferred deferred) {
		String token = notNull(command.getUserToken());
		if (!afterLoginCommands.containsKey(token)) {
			afterLoginCommands.put(token, new ArrayList<RetryCommand>());
		}
		afterLoginCommands.get(token).add(new RetryCommand(command, deferred));
	}
731135
public void postProgrammaticAuthenticate(HttpServletRequest req, HttpServletResponse resp, AuthenticationResult authResult) {
        postProgrammaticAuthenticate(req, resp, authResult, false, true);
    }
521428
public void doSignup( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
        if (getSecurityRealm().allowsSignup()) {
            req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp);
            return;
        }
        req.getView(SecurityRealm.class, "signup.jelly").forward(req, rsp);
    }
1309510
public function afterRegistry()
    {
        parent::afterRegistry();

        if ($this->showForRespondents && is_bool($this->showForRespondents)) {
            $this->showForRespondents = $this->_('Respondents');
        }
        if ($this->showForStaff && is_bool($this->showForStaff)) {
            $this->showForStaff = $this->_('Staff');
        }
        if ($this->showForTracks && is_bool($this->showForTracks)) {
            $this->showForTracks = $this->_('Tracks');
        }
        if ($this->showTitle && is_bool($this->showTitle)) {
            $this->showTitle = $this->_('Add');
        }
    }