Service/ClientProvider.php
private function refreshToken(\Google_Client $client): bool
    {
        $accessToken = $client->getAccessToken();
        $data = \json_decode($accessToken, true);

        try {
            if (isset($data['refresh_token'])) {
                $client->refreshToken($data['refresh_token']);

                return true;
            }
        } catch (\Google_Auth_Exception $e) {
        }

        return false;
    }
private function refreshToken(\Google_Client $client): bool
    {
        $accessToken = $client->getAccessToken();
        $data = \json_decode($accessToken, true);

        try {
            if (isset($data['refresh_token'])) {
                $client->refreshToken($data['refresh_token']);

                return true;
            }
        } catch (\Google_Auth_Exception $e) {
        }

        return false;
    }
private function refreshToken ( \ Google_Client $ client ) : bool { $ accessToken = $ client -> getAccessToken ( ) ; $ data = \ json_decode ( $ accessToken , true ) ; try { if ( isset ( $ data [ 'refresh_token' ] ) ) { $ client -> refreshToken ( $ data [ 'refresh_token' ] ) ; return true ; } } catch ( \ Google_Auth_Exception $ e ) { } return false ; }
If we got a refresh token, use it to retrieve a good access token.
If we got a refresh token use it to retrieve a good access token .