Skip to content

Commit 1c61da7

Browse files
committed
Always renew apppasswords on login
Else you can end up that you renewed your password (LDAP for example). But they still don't work because you did not use them before you logged in. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
1 parent 3e35d2c commit 1c61da7

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/private/Authentication/Token/PublicKeyTokenProvider.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,6 @@ public function markPasswordInvalid(IToken $token, string $tokenId) {
414414
public function updatePasswords(string $uid, string $password) {
415415
$this->cache->clear();
416416

417-
if (!$this->mapper->hasExpiredTokens($uid)) {
418-
// Nothing to do here
419-
return;
420-
}
421-
422417
// Update the password for all tokens
423418
$tokens = $this->mapper->getTokenByUser($uid);
424419
foreach ($tokens as $t) {

tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,7 @@ public function testUpdatePasswords() {
548548
IToken::PERMANENT_TOKEN,
549549
IToken::REMEMBER);
550550

551-
$this->mapper->expects($this->once())
552-
->method('hasExpiredTokens')
551+
$this->mapper->method('hasExpiredTokens')
553552
->with($uid)
554553
->willReturn(true);
555554
$this->mapper->expects($this->once())
@@ -568,8 +567,7 @@ public function testUpdatePasswords() {
568567
public function testUpdatePasswordsNotRequired() {
569568
$uid = 'myUID';
570569

571-
$this->mapper->expects($this->once())
572-
->method('hasExpiredTokens')
570+
$this->mapper->method('hasExpiredTokens')
573571
->with($uid)
574572
->willReturn(false);
575573
$this->mapper->expects($this->never())

0 commit comments

Comments
 (0)