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 8e3e1f9a32
commit 0c7f0a7d89
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()
];