Skip to content

Commit

Permalink
regenerate session on user update
Browse files Browse the repository at this point in the history
  • Loading branch information
alcalbg committed May 24, 2022
1 parent 6e2b68f commit fcd3995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/Services/Auth/Adapters/JsonFile.php
Expand Up @@ -53,7 +53,7 @@ public function user(): ?User

if ($user) {
foreach ($this->getUsers() as $u) {
if ($u['username'] == $user->getUsername() && $hash == $u['password']) {
if ($u['username'] == $user->getUsername() && $hash == $u['password'].$u['permissions'].$u['homedir'].$u['role']) {
return $user;
}
}
Expand All @@ -70,7 +70,7 @@ public function authenticate($username, $password): bool
if ($u['username'] == $username && $this->verifyPassword($password, $u['password'])) {
$user = $this->mapToUserObject($u);
$this->store($user);
$this->session->set(self::SESSION_HASH, $u['password']);
$this->session->set(self::SESSION_HASH, $u['password'].$u['permissions'].$u['homedir'].$u['role']);

return true;
}
Expand Down

0 comments on commit fcd3995

Please sign in to comment.