Merge pull request #51880 from nextcloud/backport/51870/stable31

[stable31] fix: Use login name to check the password
This commit is contained in:
Louis 2025-04-03 10:18:49 +02:00 committed by GitHub
commit 5d1a7b7b1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,8 @@ class PasswordConfirmationMiddleware extends Middleware {
if ($this->isPasswordConfirmationStrict($reflectionMethod)) {
$authHeader = $this->request->getHeader('Authorization');
[, $password] = explode(':', base64_decode(substr($authHeader, 6)), 2);
$loginResult = $this->userManager->checkPassword($user->getUid(), $password);
$loginName = $this->session->get('loginname');
$loginResult = $this->userManager->checkPassword($loginName, $password);
if ($loginResult === false) {
throw new NotConfirmedException();
}