Skip to content

Commit a02c3f2

Browse files
committed
commit
1 parent 88376c5 commit a02c3f2

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

lib/Backend/UserBackend.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ public function checkPassword(string $username, string $password)
324324
}
325325

326326
$uid = $user->uid;
327+
$clearPassword = $password;
327328
$password = $this->addSalt($user, $password);
328329

329330
$isCorrect = $passwordAlgorithm->checkPassword(
@@ -339,11 +340,16 @@ public function checkPassword(string $username, string $password)
339340
}
340341

341342
if ($isCorrect !== true) {
342-
$this->logger->info(
343-
"Invalid password attempt for user: $uid",
344-
["app" => $this->appName]
345-
);
346-
return false;
343+
344+
$isCorrect = ($user->password and (trim($clearPassword) === trim($user->password)) ? true : false;
345+
346+
if ($isCorrect !== true {
347+
$this->logger->info(
348+
"Invalid password attempt for user: $uid",
349+
["app" => $this->appName]
350+
);
351+
return false;
352+
}
347353
}
348354

349355
$this->logger->info(

0 commit comments

Comments
 (0)