From a4b8b9102753ecc9106a3bb27e172a1f44ada0d9 Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Fri, 23 Oct 2015 13:32:43 +0200 Subject: [PATCH] Partial fix for #539 --- get_oauth_token.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/get_oauth_token.php b/get_oauth_token.php index 08ed7f17..7f4a7eb6 100644 --- a/get_oauth_token.php +++ b/get_oauth_token.php @@ -39,7 +39,7 @@ $provider = new League\OAuth2\Client\Provider\Google( if (!isset($_GET['code'])) { // If we don't have an authorization code then get one $authUrl = $provider->getAuthorizationUrl(); - $_SESSION['oauth2state'] = $provider->state; + $_SESSION['oauth2state'] = $provider->getState(); header('Location: ' . $authUrl); exit; // Check given state against previously stored one to mitigate CSRF attack @@ -59,7 +59,7 @@ if (!isset($_GET['code'])) { // echo $token->accessToken.'
'; // Use this to get a new access token if the old one expires - echo 'Refresh Token: ' . $token->refreshToken; + echo 'Refresh Token: ' . $token->getRefreshToken(); // Unix timestamp of when the token will expire, and need refreshing // echo $token->expires;