Skip to content

Commit 339680c

Browse files
n0emisjuliusknorr
authored andcommitted
Don't try to hash a nonexisting password
Allows to log-in via a passwordless authentication provider, eg SSO Signed-off-by: Ember 'n0emis' Keske <git@n0emis.eu>
1 parent 62cfd3b commit 339680c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/Authentication/Token/PublicKeyTokenProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function generateToken(string $token,
113113
// We need to check against one old token to see if there is a password
114114
// hash that we can reuse for detecting outdated passwords
115115
$randomOldToken = $this->mapper->getFirstTokenForUser($uid);
116-
$oldTokenMatches = $randomOldToken && $randomOldToken->getPasswordHash() && $this->hasher->verify(sha1($password) . $password, $randomOldToken->getPasswordHash());
116+
$oldTokenMatches = $randomOldToken && $randomOldToken->getPasswordHash() && $password !== null && $this->hasher->verify(sha1($password) . $password, $randomOldToken->getPasswordHash());
117117

118118
$dbToken = $this->newToken($token, $uid, $loginName, $password, $name, $type, $remember);
119119

0 commit comments

Comments
 (0)