Skip to content

Commit 4998967

Browse files
committed
Handle one time password better
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 22de243 commit 4998967

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/private/Authentication/Token/PublicKeyTokenProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public function updatePasswords(string $uid, string $password) {
401401
$this->cache->clear();
402402

403403
// prevent setting an empty pw as result of pw-less-login
404-
if ($password === '') {
404+
if ($password === '' || !$this->config->getSystemValueBool('auth.storeCryptedPassword', true)) {
405405
return;
406406
}
407407

tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ protected function setUp(): void {
6666
['secret', '', '1f4h9s'],
6767
['openssl', [], []],
6868
]);
69+
$this->config->method('getSystemValueBool')
70+
->willReturnMap([
71+
['auth.storeCryptedPassword', true, true],
72+
]);
6973
$this->logger = $this->createMock(LoggerInterface::class);
7074
$this->timeFactory = $this->createMock(ITimeFactory::class);
7175
$this->time = 1313131;

0 commit comments

Comments
 (0)