Skip to content

Commit 5d1a7b7

Browse files
authored
Merge pull request #51880 from nextcloud/backport/51870/stable31
[stable31] fix: Use login name to check the password
2 parents b7d1157 + 81e70c9 commit 5d1a7b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public function beforeController(Controller $controller, string $methodName) {
8080
if ($this->isPasswordConfirmationStrict($reflectionMethod)) {
8181
$authHeader = $this->request->getHeader('Authorization');
8282
[, $password] = explode(':', base64_decode(substr($authHeader, 6)), 2);
83-
$loginResult = $this->userManager->checkPassword($user->getUid(), $password);
83+
$loginName = $this->session->get('loginname');
84+
$loginResult = $this->userManager->checkPassword($loginName, $password);
8485
if ($loginResult === false) {
8586
throw new NotConfirmedException();
8687
}

0 commit comments

Comments
 (0)