summaryrefslogtreecommitdiff
path: root/app/Auth
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
committerFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
commita675271ad71b7713d1b33bdba3c51b2b04813229 (patch)
treee54d8a95e16ca521193b9fd5a5eb071aa2910823 /app/Auth
parent2fc402f6733573627ad25394d109b9f848ef04f6 (diff)
Rewrite of session management
Diffstat (limited to 'app/Auth')
-rw-r--r--app/Auth/Database.php2
-rw-r--r--app/Auth/Github.php2
-rw-r--r--app/Auth/Gitlab.php2
-rw-r--r--app/Auth/Google.php2
-rw-r--r--app/Auth/Ldap.php2
-rw-r--r--app/Auth/RememberMe.php4
-rw-r--r--app/Auth/ReverseProxy.php2
7 files changed, 8 insertions, 8 deletions
diff --git a/app/Auth/Database.php b/app/Auth/Database.php
index 91b17a5f..c2041d4d 100644
--- a/app/Auth/Database.php
+++ b/app/Auth/Database.php
@@ -39,7 +39,7 @@ class Database extends Base
->findOne();
if (is_array($user) && password_verify($password, $user['password'])) {
- $this->userSession->refresh($user);
+ $this->userSession->initialize($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
}
diff --git a/app/Auth/Github.php b/app/Auth/Github.php
index b89dc5b8..4777152a 100644
--- a/app/Auth/Github.php
+++ b/app/Auth/Github.php
@@ -39,7 +39,7 @@ class Github extends Base
$user = $this->user->getByGithubId($github_id);
if (! empty($user)) {
- $this->userSession->refresh($user);
+ $this->userSession->initialize($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
}
diff --git a/app/Auth/Gitlab.php b/app/Auth/Gitlab.php
index a59bc1fa..698b59c3 100644
--- a/app/Auth/Gitlab.php
+++ b/app/Auth/Gitlab.php
@@ -39,7 +39,7 @@ class Gitlab extends Base
$user = $this->user->getByGitlabId($gitlab_id);
if (! empty($user)) {
- $this->userSession->refresh($user);
+ $this->userSession->initialize($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
}
diff --git a/app/Auth/Google.php b/app/Auth/Google.php
index 32bcb4b1..6c1bc3cd 100644
--- a/app/Auth/Google.php
+++ b/app/Auth/Google.php
@@ -40,7 +40,7 @@ class Google extends Base
$user = $this->user->getByGoogleId($google_id);
if (! empty($user)) {
- $this->userSession->refresh($user);
+ $this->userSession->initialize($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
}
diff --git a/app/Auth/Ldap.php b/app/Auth/Ldap.php
index c252be17..3d361aa7 100644
--- a/app/Auth/Ldap.php
+++ b/app/Auth/Ldap.php
@@ -237,7 +237,7 @@ class Ldap extends Base
}
// We open the session
- $this->userSession->refresh($user);
+ $this->userSession->initialize($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
diff --git a/app/Auth/RememberMe.php b/app/Auth/RememberMe.php
index fd8ed8bb..0a567cbe 100644
--- a/app/Auth/RememberMe.php
+++ b/app/Auth/RememberMe.php
@@ -101,10 +101,10 @@ class RememberMe extends Base
);
// Create the session
- $this->userSession->refresh($this->user->getById($record['user_id']));
+ $this->userSession->initialize($this->user->getById($record['user_id']));
// Do not ask 2FA for remember me session
- $this->session['2fa_validated'] = true;
+ $this->sessionStorage->postAuth['validated'] = true;
$this->container['dispatcher']->dispatch(
'auth.success',
diff --git a/app/Auth/ReverseProxy.php b/app/Auth/ReverseProxy.php
index 1910ad35..d119ca98 100644
--- a/app/Auth/ReverseProxy.php
+++ b/app/Auth/ReverseProxy.php
@@ -48,7 +48,7 @@ class ReverseProxy extends Base
$user = $this->user->getByUsername($login);
}
- $this->userSession->refresh($user);
+ $this->userSession->initialize($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;