1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-03 22:57:27 +02:00

Reflect changed email address in same session immediately

This commit is contained in:
Marco
2017-07-30 20:24:19 +02:00
parent ea67c66bd1
commit 39f9b00b45

View File

@@ -511,6 +511,15 @@ final class Auth extends UserManager {
throw new DatabaseError();
}
// if the user is currently signed in
if ($this->isLoggedIn()) {
// if the user has just confirmed an email address for their own account
if ($this->getUserId() === $confirmationData['user_id']) {
// immediately update the email address in the current session as well
$this->setEmail($confirmationData['email']);
}
}
try {
$this->db->delete(
$this->dbTablePrefix . 'users_confirmations',