public function validateRefreshToken($refreshToken, $clientId)
    {
        $result = DB::table('oauth_session_refresh_tokens')
                    ->where('refresh_token', $refreshToken)
                    ->where('client_id', $clientId)
                    ->where('refresh_token_expires', '>=', time())
                    ->first();

        return (is_null($result)) ? false : $result->session_access_token_id;
    }
public function validateRefreshToken($refreshToken, $clientId)
    {
        $result = DB::table('oauth_session_refresh_tokens')
                    ->where('refresh_token', $refreshToken)
                    ->where('client_id', $clientId)
                    ->where('refresh_token_expires', '>=', time())
                    ->first();

        return (is_null($result)) ? false : $result->session_access_token_id;
    }
public function validateRefreshToken ( $ refreshToken , $ clientId ) { $ result = DB :: table ( 'oauth_session_refresh_tokens' ) -> where ( 'refresh_token' , $ refreshToken ) -> where ( 'client_id' , $ clientId ) -> where ( 'refresh_token_expires' , '>=' , time ( ) ) -> first ( ) ; return ( is_null ( $ result ) ) ? false : $ result -> session_access_token_id ; }
Validate a refresh token

Example SQL query:

<code>
SELECT session_access_token_id FROM `oauth_session_refresh_tokens` WHERE refresh_token = :refreshToken
AND refresh_token_expires >= UNIX_TIMESTAMP(NOW()) AND client_id = :clientId
</code>

@param  string   $refreshToken The access token
@param  string   $clientId     The client ID
@return int|bool               The ID of the access token the refresh token is linked to (or false if invalid)
Validate a refresh token