``` app.login({ email/id: "userEmailOrId", password: "pass" }); ```
500936
function login(type, customOptions, successCallback, errorCallback) {
    var successCb = successCallback,
      errorCb = errorCallback;

    if(!type){
      throw new TypeError('Credentials (for Evrythng) or type (for Third party) are missing.');
    }

    // Authenticate using third parties' OAuth.
    if(Utils.isString(type)){

      if(type === 'facebook'){
        return _loginFacebook.call(this, customOptions, successCb, errorCb);

      }else if(type === 'evrythng') {
        return _loginEvrythng.call(this, customOptions, successCb, errorCb);
      }

      /*TODO: add more authentication methods here.*/

    }else{

      // Evrythng login does not need first param. Simply call *_loginEvrythng()*
      // with shifted arguments.
      return _loginEvrythng.call(this, type, customOptions, successCb);

    }
  }
203003
function onSendPasswordResetEmail() {
  var email = $('#password-reset-email').val();
  auth.sendPasswordResetEmail(email, getActionCodeSettings()).then(function() {
    alertSuccess('Email sent!');
  }, onAuthError);
}
702207
def login(user, password)
      data = request('authenticateUser',
                     { username: user, password: password },
                     true)
      @user = User.new(self, data)
      fail InvalidAuthentication, 'Wrong username or password!' if @user.id == 0

      @user
    end
145020
def authenticate
      if @user = User.authenticate(params[:email], params[:password])
        render json: {message: @user, success: true}, status: 200
      else
        render json: {message: "Authentication failed", success: false}, status: :ok
      end
    end
541755
async def login(self, request, id_):
        """"""
        session = await self.load(request)
        session['id'] = id_
237323
function() {
        if (!this._data.session) return;

        let authDict = {};
        if (this._currentStage == EMAIL_STAGE_TYPE) {
            // The email can be validated out-of-band, but we need to provide the
            // creds so the HS can go & check it.
            if (this._emailSid) {
                const idServerParsedUrl = url.parse(
                    this._matrixClient.getIdentityServerUrl(),
                );
                authDict = {
                    type: EMAIL_STAGE_TYPE,
                    threepid_creds: {
                        sid: this._emailSid,
                        client_secret: this._clientSecret,
                        id_server: idServerParsedUrl.host,
                    },
                };
            }
        }

        this.submitAuthDict(authDict, true);
    }
693017
public static Observable<BackendUser> signInInBackground(String email, String password){
        return getAM().loginASync(new LoginCredentials(email, password));
    }
245470
function(username, pw) {
    return _.ajax({
      verb: 'POST',
      url: '/login',
      data: {
        username: username,
        password: pw
      }
    }).then(function(id) {
      document.cookie = 'user=' + id;
      return id;
    });
  }
1365717
def login(username, password)
      params = { grant_type: "password", username: username, password: password }
      response = self['token'].get({ params: params })
      user_uuid = response.data['user']['uuid']
      user_access_token = response.data['access_token']
      Thread.current[:usergrid_user_id] = user_uuid
      Thread.current[:usergrid_auth_token] = user_access_token
      @current_user = self["/users/#{user_uuid}"].get.entity
      response
    end
59476
function login(username, password) {
	if (!cocoonSDK.CocoonAPI.checkAPIAccess()) {
		return oAuth.tokenExchangePassword(username, password)
		.then((result) => {
			cocoonSDK.CocoonAPI.setupAPIAccess(result.access_token, result.refresh_token, result.expires_in);
			return undefined;
		})
		.catch((error) => {
			console.error("Login not successful.");
			console.trace(error);
			throw error;
		});
	} else {
		return Promise.resolve();
	}
}
830004
def login(self, username, password):
        
        self._user = username
        self._pass = password
        return self._login()
690231
def send_login_email(app_id, token, hook, email=None, user_id=None, lang="en_US",
                     url_login='https://pswdless.appspot.com/rest/login'):
    '''
    
    '''
    return SendLoginEmail(app_id, token, hook, email, user_id, lang, url_login)
579530
def login(self, user, passwd):
        ''''''
        resp = self.post('token', json={'username': user, 'password': passwd})
        self._token = resp.json()['response']['token']
1329060
function login(type) {
	
	var input = getInput();
	
	var onDone = function (err, result) {
		if (err) {
			console.error(err);
			// switch for various errors
			switch (err) {				
				case 'ACCOUNT_EXISTS':
					alert(l_lang.err_exists);
					break;
				case 'INVALID_EMAIL':
					alert(l_lang.err_email);
					break;		
				case 'INVALID_ACCOUNT':
				case 'INVALID_PASSWORD_OR_TOKEN':
					alert(l_lang.err_notfound);
					break;					
				case 'INVALID_DATA':
				case 'UID_ERROR':
				case 'DB_ERROR':
				case 'GROUP_ERROR':
				default:
					alert(err);
					break;
			}
			return;
		}

		// do not redirect if it's just to reset password or register
		if (type === 'getpass')
			return;
		
		// try to login if register success
		if (type === 'register') {
			alert(l_lang.register_success);
			login('account');
			return;
		}
		
		alert(l_lang.login_success);
		window.location = '/main';		
	}
	
	switch (type) {
		case 'register':
			if (input.account === '' || input.password === '' || input.email === '') {
				return alert(l_lang.err_incomplete);	
			}
			SR.API._ACCOUNT_REGISTER(input, onDone);
			break;
		case 'account':
			console.log('calling _ACCOUNT_LOGIN');
			SR.API._ACCOUNT_LOGIN(input, onDone);
			break;
		case 'getpass':
			SR.API._ACCOUNT_RESETPASS(input, onDone);
			break;
		default:
			alert('unknown login type');
			break;
	}
}
1294839
function(request, username, password, callback) {
    const user = users[username];
    if (!user) {
        return callback(null, false);
    }
    const isValid = password === user.password;
    callback(null, isValid, { id: user.id, name: user.name });
}
125030
public ApiResponse authorizeAppUser(String email, String password) {
        validateNonEmptyParam(email, "email");
        validateNonEmptyParam(password,"password");
        assertValidApplicationId();
        loggedInUser = null;
        accessToken = null;
        currentOrganization = null;
        Map<String, Object> formData = new HashMap<String, Object>();
        formData.put("grant_type", "password");
        formData.put("username", email);
        formData.put("password", password);
        ApiResponse response = apiRequest(HttpMethod.POST, formData, null,
                organizationId, applicationId, "token");
        if (response == null) {
            return response;
        }
        if (!isEmpty(response.getAccessToken()) && (response.getUser() != null)) {
            loggedInUser = response.getUser();
            accessToken = response.getAccessToken();
            currentOrganization = null;
            log.info("Client.authorizeAppUser(): Access token: " + accessToken);
        } else {
            log.info("Client.authorizeAppUser(): Response: " + response);
        }
        return response;
    }
516315
function ( appRequest, appResponse ) {
    var data = {
        email: appRequest.body.email,
        password: appRequest.body.password
    };

    if ( !data.email || !data.password ) {
        appResponse.send( loginHTML );

        return;
    }

    appLogin( data, appResponse, function () {
        // End login post
        appResponse.json({
            success: true
        });
    });
}