Also fix the username when it changed

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-12-17 11:47:17 +01:00
parent 76367c5c38
commit 831c807eaf
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 3 additions and 2 deletions

View File

@ -52,9 +52,10 @@ class StorePasswordListener implements IEventListener {
$stored = $this->credentialsManager->retrieve($event->getUser()->getUID(), LoginCredentials::CREDENTIALS_IDENTIFIER);
if ($stored && $stored['password'] !== $event->getPassword()) {
if ($stored && ($stored['user'] !== $event->getUser()->getUID()
|| $stored['password'] !== $event->getPassword())) {
$credentials = [
'user' => $stored['user'],
'user' => $event->getUser()->getUID(),
'password' => $event->getPassword()
];