From 831c807eafa7887eb7072513b4413b8c2a8d102b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 17 Dec 2020 11:47:17 +0100 Subject: [PATCH] Also fix the username when it changed Signed-off-by: Joas Schilling --- apps/files_external/lib/Listener/StorePasswordListener.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files_external/lib/Listener/StorePasswordListener.php b/apps/files_external/lib/Listener/StorePasswordListener.php index 3212f2a48c..f1683af2ec 100644 --- a/apps/files_external/lib/Listener/StorePasswordListener.php +++ b/apps/files_external/lib/Listener/StorePasswordListener.php @@ -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() ];