diff --git a/lib/private/Authentication/Listeners/UserLoggedInListener.php b/lib/private/Authentication/Listeners/UserLoggedInListener.php index 9d90f09b29626..faf2edd54f7ec 100644 --- a/lib/private/Authentication/Listeners/UserLoggedInListener.php +++ b/lib/private/Authentication/Listeners/UserLoggedInListener.php @@ -48,6 +48,11 @@ public function handle(Event $event): void { return; } + // prevent setting an empty pw as result of pw-less-login + if ($event->getPassword() === '') { + return; + } + // If this is already a token login there is nothing to do if ($event->isTokenLogin()) { return; diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index a6498ca99232e..81dc3164ec141 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -419,6 +419,11 @@ public function updatePasswords(string $uid, string $password) { return; } + // prevent setting an empty pw as result of pw-less-login + if ($password === '') { + return; + } + // Update the password for all tokens $tokens = $this->mapper->getTokenByUser($uid); foreach ($tokens as $t) {