Skip to content

Commit c3d0afd

Browse files
authored
Merge pull request #51879 from nextcloud/backport/51870/stable30
[stable30] fix: Use login name to check the password
2 parents a61d561 + 84b59c4 commit c3d0afd

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)