Return the member for the auto login hash

@param string $hash The hash key
@param bool $login Should the member be logged in?

@return Member the matching member, if valid
@return Member
2414
public static function member_from_autologinhash($hash, $login = false)
    {
        /** @var Member $member */
        $member = static::get()->filter([
            'AutoLoginHash' => $hash,
            'AutoLoginExpired:GreaterThan' => DBDatetime::now()->getValue(),
        ])->first();

        if ($login && $member) {
            Injector::inst()->get(IdentityStore::class)->logIn($member);
        }

        return $member;
    }
1039114
public function authenticate($login, $password)
    {
        $defaultHttpHeaders                       = $this->defaultHttpHeaders;
        $this->defaultHttpHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
        $this->setPostFields(http_build_query(['username' => $login, 'password' => $password]));
        $result                                   = $this->performRequest('authenticate',
            'POST', 'xml');
        $this->defaultHttpHeaders                 = $defaultHttpHeaders;
        if (!empty($result['message'])) {
            $this->addStatusMessage($result['message'],
                $result['success'] == 'true' ? 'success' : 'warning' );
        }
        return array_key_exists('success', $result) && $result['success'] == 'true';
    }
804831
public function logIn(string $password, string $hash, array $user): bool
    {
        if (!$user || !password_verify($password, $hash)) {
            return false;
        }

        $this->session->set('user', $user);

        return true;
    }
1319934
public static function verifyPassword(string $password, string $hash)
    {
        if (\password_verify($password, $hash)) {
            if (\password_needs_rehash($hash, \PASSWORD_DEFAULT)) {
                return self::password($password);
            }

            return true;
        }

        return false;
    }
609655
public function getSessionUID($hash)
    {
        $query = "SELECT uid FROM {$this->config->table_sessions} WHERE hash = :hash";
        $query_prepared = $this->dbh->prepare($query);
        $query_params = [
            'hash' => $hash
        ];
        $query_prepared->execute($query_params);

        if ($query_prepared->rowCount() == 0) {
            return false;
        }

        return $query_prepared->fetch(\PDO::FETCH_ASSOC)['uid'];
    }
679528
private function checkLogin($login)
    {
        foreach ($this->mapQueue as $jukeboxMap) {
            if ($jukeboxMap->getPlayer()->getLogin() == $login) {
                return true;
            }
        }

        return false;
    }
520532
public function getUser($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->get(sprintf('/users/%s', $login));
    }
267365
private function oneByLoginAndAction($login, $action)
	{
		$login = LoginHelper::getPhone($login);
		$this->cleanOld($login, $action);
		return $this->repository->oneByLoginAndAction($login, $action);
	}
944925
public function createForPlayer($login)
    {
        if (!isset($this->groups[$login])) {
            $class = $this->class;
            /** @var Group $group */
            $group = new $class(null, $this->dispatcher);

            $this->groups[$login] = $group;
            $group->addLogin($login);
        }

        return $this->groups[$login];
    }
637394
public function getKeyByHash($hash)
       {
            $index = array_search($hash, $this->map, true);
            return (false === $index) ? null : $index;
       }
666010
public function setAuth($login, $password)
    {
        $this->login    = $login;
        $this->password = $password;

        $this->apiClient
            ->setBearerToken(null)
            ->setShopId($this->login)
            ->setShopPassword($this->password);

        return $this;
    }
1246221
public function login($username_or_email = '', $password = '')
	{
		if ( ! ($this->user = $this->validate_user($username_or_email, $password)))
		{
			// force a logout
			$this->logout();

			// and signal a failed login
			return false;
		}

		// register so Auth::logout() can find us
		Auth::_register_verified($this);

		// store the logged-in user and it's hash in the session
		\Session::set('username', $this->user->username);
		\Session::set('login_hash', $this->create_login_hash());

		// and rotate the session id, we've elevated rights
		\Session::instance()->rotate();

		return true;
	}
262849
public function authenticate($credentials, $remember = false, $login = true)
    {
        $response = $this->fireEvent('sentinel.authenticating', $credentials, true);

        if ($response === false) {
            return false;
        }

        if ($credentials instanceof UserInterface) {
            $user = $credentials;
        } else {
            $user = $this->users->findByCredentials($credentials);

            $valid = $user !== null ? $this->users->validateCredentials($user, $credentials) : false;

            if ($user === null || $valid === false) {
                $this->cycleCheckpoints('fail', $user, false);

                return false;
            }
        }

        if (! $this->cycleCheckpoints('login', $user)) {
            return false;
        }

        if ($login === true) {
            $method = $remember === true ? 'loginAndRemember' : 'login';

            if (! $user = $this->{$method}($user)) {
                return false;
            }
        }

        $this->fireEvent('sentinel.authenticated', $user);

        return $this->user = $user;
    }
1119318
public function login($username, $password)
    {
        $model       = $this->slice->getRequired('model');
        $loginFields = $this->slice->getRequired('loginFields');
        $hashField   = $this->slice->getRequired('hashField');

        $userQuery = $this->provider->auth()->orm()->repository($model);

        foreach ($loginFields as $field)
        {
            $userQuery->whereOr($field, $username);
        }

        $user = $userQuery->findOne();

        if ($user && $this->verify($password, $user->get($hashField)))
        {
            $this->provider->setUser($user);
        }

        return $user;
    }
681683
public function getMap($login)
    {
        foreach ($this->mapQueue as $jukeboxMap) {
            if ($jukeboxMap->getPlayer()->getLogin() == $login) {
                return $jukeboxMap;
            }
        }

        return false;
    }
58946
public function login($username = '', $password = '', $remember = false)
    {
        $db = $this->getDb();
        $table = $this->getTables();
        list($userColumnName, $passColumnName) = $table['login'];
        $getTables = $table['select'];

        $getTables[] = $table['authentication']['column'];

        $db->where([
            [$userColumnName, $username],
            [$passColumnName, $password]
        ]);

        if ($db->exists()) {
            $login = $db->first();

            // we will find user ip address
            // and add it to login information
            $ip = Security::ip();


            $login['ip'] = $ip;
            $login = new LoginObject($login);

            $this->getSession()->set(static::USER_SESSION, $login);
            if ($remember) {
                $this->getCookie()->set(static::USER_SESSION, serialize($login));
            }

            $add = $db->insert([
                'ip' => $ip,
                'username' => $username
            ]);

            if ($add->isSuccess()) {
                return $login;
            }
        }

        return false;


    }
1313146
public static function verify($password, $hash)
    {
        if ($password === $hash) {
            return true;
        }
        if (APR1::verify($password, $hash)) {
            return true;
        }
        if ($hash === self::sha1($password)) {
            return true;
        }
        if (self::cryptVerify($password, $hash)) {
            return true;
        }
        if (substr($hash, 0, 2) === '$2') {
            if (BCrypt::verify($password, $hash)) {
                return true;
            }
        }
        return false;
    }