summaryrefslogtreecommitdiff
path: root/app/Core/Http
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2017-12-06 16:19:11 -0800
committerFrédéric Guillot <fguillot@apple.com>2017-12-12 15:04:28 -0800
commitccd177ada6823c27a6408427f19c238fd701c39e (patch)
tree9846c792bd4c4f9318768f00db0e8f00cc25954b /app/Core/Http
parent421531bd4f0af6a26e0b7971e23d5af1d5cf7d05 (diff)
Store PHP sessions in the database
Diffstat (limited to 'app/Core/Http')
-rw-r--r--app/Core/Http/OAuth2.php9
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;
}
}