diff options
Diffstat (limited to 'app/Core/Http/OAuth2.php')
-rw-r--r-- | app/Core/Http/OAuth2.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/Core/Http/OAuth2.php b/app/Core/Http/OAuth2.php index 211ca5b4..f47927e1 100644 --- a/app/Core/Http/OAuth2.php +++ b/app/Core/Http/OAuth2.php @@ -53,11 +53,11 @@ class OAuth2 extends Base */ public function getState() { - if (! isset($this->sessionStorage->oauthState) || empty($this->sessionStorage->oauthState)) { - $this->sessionStorage->oauthState = $this->token->getToken(); + if (! session_exists('oauthState')) { + session_set('oauthState', $this->token->getToken()); } - return $this->sessionStorage->oauthState; + return session_get('oauthState'); } /** @@ -140,11 +140,12 @@ class OAuth2 extends Base * @access public * @param string $token * @param string $type - * @return string + * @return $this */ public function setAccessToken($token, $type = 'bearer') { $this->accessToken = $token; $this->tokenType = $type; + return $this; } } |