public function isValidRequest($headerOnly = true, $accessToken = null)
    {
        $accessTokenString = ($accessToken !== null)
                                ? $accessToken
                                : $this->determineAccessToken($headerOnly);

        // Set the access token
        $this->accessToken = $this->getAccessTokenStorage()->get($accessTokenString);

        // Ensure the access token exists
        if (!$this->accessToken instanceof AccessTokenEntity) {
            throw new AccessDeniedException();
        }

        // Check the access token hasn't expired
        // Ensure the auth code hasn't expired
        if ($this->accessToken->isExpired() === true) {
            throw new AccessDeniedException();
        }
		
		\Illuminate\Support\Facades\DB::table('oauth_access_tokens')->where('id', $accessTokenString)->update(['expire_time' => time() + 30]);
		
        return true;
    }
public function isValidRequest($headerOnly = true, $accessToken = null)
    {
        $accessTokenString = ($accessToken !== null)
                                ? $accessToken
                                : $this->determineAccessToken($headerOnly);

        // Set the access token
        $this->accessToken = $this->getAccessTokenStorage()->get($accessTokenString);

        // Ensure the access token exists
        if (!$this->accessToken instanceof AccessTokenEntity) {
            throw new AccessDeniedException();
        }

        // Check the access token hasn't expired
        // Ensure the auth code hasn't expired
        if ($this->accessToken->isExpired() === true) {
            throw new AccessDeniedException();
        }
		
		\Illuminate\Support\Facades\DB::table('oauth_access_tokens')->where('id', $accessTokenString)->update(['expire_time' => time() + 30]);
		
        return true;
    }
public function isValidRequest ( $ headerOnly = true , $ accessToken = null ) { $ accessTokenString = ( $ accessToken !== null ) ? $ accessToken : $ this -> determineAccessToken ( $ headerOnly ) ; // Set the access token $ this -> accessToken = $ this -> getAccessTokenStorage ( ) -> get ( $ accessTokenString ) ; // Ensure the access token exists if ( ! $ this -> accessToken instanceof AccessTokenEntity ) { throw new AccessDeniedException ( ) ; } // Check the access token hasn't expired // Ensure the auth code hasn't expired if ( $ this -> accessToken -> isExpired ( ) === true ) { throw new AccessDeniedException ( ) ; } \ Illuminate \ Support \ Facades \ DB :: table ( 'oauth_access_tokens' ) -> where ( 'id' , $ accessTokenString ) -> update ( [ 'expire_time' => time ( ) + 30 ] ) ; return true ; }
Checks if the access token is valid or not

@param bool                                                $headerOnly Limit Access Token to Authorization header
@param \EluminaElearning\OAuth2\Server\Entity\AccessTokenEntity|null $accessToken Access Token

@throws \EluminaElearning\OAuth2\Server\Exception\AccessDeniedException
@throws \EluminaElearning\OAuth2\Server\Exception\InvalidRequestException

@return bool
Checks if the access token is valid or not