Fix: password change should update session user data

This commit is contained in:
Bartek Fabiszewski 2019-12-28 18:56:11 +01:00
parent 3e8e6b08c5
commit b0178e90fa
3 changed files with 11 additions and 1 deletions

View File

@ -41,6 +41,15 @@
}
}
/**
* Update user instance stored in session
*/
public function updateSession() {
if ($this->isAuthenticated()) {
$this->user->storeInSession();
}
}
/**
* Is user authenticated
*

View File

@ -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());

View File

@ -54,7 +54,7 @@
if ($passUser->setPass($pass) === false) {
uUtils::exitWithError("Server error");
}
$auth->updateSession();
uUtils::exitWithSuccess();
?>