Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
draft to prevent the invalidation of pw based authn tokens on a pw le…
…ss login

Signed-off-by: Tobias Assmann <[email protected]>
  • Loading branch information
Tobias Assmann authored and juliusknorr committed Oct 8, 2021
commit 4fd1b09a600a90d37d8f0e6d7721e2a09b38f429
5 changes: 5 additions & 0 deletions lib/private/Authentication/Listeners/UserLoggedInListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,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;
Expand Down
5 changes: 5 additions & 0 deletions lib/private/Authentication/Token/PublicKeyTokenProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ public function markPasswordInvalid(IToken $token, string $tokenId) {
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) {
Expand Down