Devise\Users\Sessions\SessionsRepository::attemptUserLogin PHP Method

attemptUserLogin() protected method

Iterates through an array of username/email fields in the users table and attempts to authenticate an instance of DvsUser
protected attemptUserLogin ( array $input ) : DvsUser | false
$input array
return DvsUser | false | false
    protected function attemptUserLogin($input)
    {
        // fieldnames in order or precedence
        $fieldnames = $this->checkFieldExists('username') ? ['username', 'email'] : ['email'];
        foreach ($fieldnames as $fieldname) {
            if ($this->Auth->attempt(array($fieldname => $input['uname_or_email'], 'password' => $input['password'], 'activated' => 1), $this->getRememberMe($input))) {
                return $this->retrieveUserFindMethodByField($fieldname, $input['uname_or_email']);
            }
        }
        return false;
    }