Fix: password change should update session user data
This commit is contained in:
parent
3e8e6b08c5
commit
b0178e90fa
@ -41,6 +41,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update user instance stored in session
|
||||
*/
|
||||
public function updateSession() {
|
||||
if ($this->isAuthenticated()) {
|
||||
$this->user->storeInSession();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is user authenticated
|
||||
*
|
||||
|
@ -140,6 +140,7 @@
|
||||
$stmt = self::db()->prepare($query);
|
||||
$stmt->execute([ $hash, $this->login ]);
|
||||
$ret = true;
|
||||
$this->hash = $hash;
|
||||
} catch (PDOException $e) {
|
||||
// TODO: handle exception
|
||||
syslog(LOG_ERR, $e->getMessage());
|
||||
|
@ -54,7 +54,7 @@
|
||||
if ($passUser->setPass($pass) === false) {
|
||||
uUtils::exitWithError("Server error");
|
||||
}
|
||||
|
||||
$auth->updateSession();
|
||||
uUtils::exitWithSuccess();
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user