Gdn_Authenticator::lookupToken PHP Method

lookupToken() public method

public lookupToken ( $ProviderKey, $UserKey, null $TokenType = null ) : array | boolean | stdClass
$ProviderKey
$UserKey
$TokenType null
return array | boolean | stdClass
    public function lookupToken($ProviderKey, $UserKey, $TokenType = null)
    {
        $TokenData = Gdn::database()->sql()->select('uat.*')->from('UserAuthenticationToken uat')->where('uat.ForeignUserKey', $UserKey)->where('uat.ProviderKey', $ProviderKey)->beginWhereGroup()->where('(uat.Timestamp + uat.Lifetime) >=', 'NOW()', true, false)->orWhere('uat.Lifetime', 0)->endWhereGroup()->get()->firstRow(DATASET_TYPE_ARRAY);
        if ($TokenData && (is_null($TokenType) || strtolower($TokenType) == strtolower($TokenData['TokenType']))) {
            return $TokenData;
        }
        return false;
    }