src/AuthorizesWithOAuth2.php
public function refreshIfExpired()
    {
        $user = $this->getFrameworkBridge()->getCurrentUser();

        if (! $user) {
            return null;
        }

        $token = $user->getOAuthToken();
        if ($token && $token->hasExpired()) {
            $this->refreshAccessToken($token);
        }
    }
public function refreshIfExpired()
    {
        $user = $this->getFrameworkBridge()->getCurrentUser();

        if (! $user) {
            return null;
        }

        $token = $user->getOAuthToken();
        if ($token && $token->hasExpired()) {
            $this->refreshAccessToken($token);
        }
    }
public function refreshIfExpired ( ) { $ user = $ this -> getFrameworkBridge ( ) -> getCurrentUser ( ) ; if ( ! $ user ) { return null ; } $ token = $ user -> getOAuthToken ( ) ; if ( $ token && $ token -> hasExpired ( ) ) { $ this -> refreshAccessToken ( $ token ) ; } }
If a user is logged in & has an expired access token,
fetch a new one using their refresh token.

@return void
If a user is logged in & has an expired access token fetch a new one using their refresh token .