Rewrite of session management
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user