mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #29130 from nextcloud/backport/27886/stable21
[stable21] Keep pw based auth tokens valid when pw-less login happens
This commit is contained in:
commit
e229cd3d53
2 changed files with 10 additions and 0 deletions
|
|
@ -49,6 +49,11 @@ class UserLoggedInListener implements IEventListener {
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -414,6 +414,11 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
public function updatePasswords(string $uid, string $password) {
|
||||
$this->cache->clear();
|
||||
|
||||
// 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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue