summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-09-10 19:06:50 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2021-09-10 19:06:50 +0200
commit6857136f06190acad26a4dfc541c9c688aa75014 (patch)
treea6eef94a3dababa542bd055d16ea2e5d924f2fce /core/Controller
parent43fcd28ea05824b4a69d676ca8934812555f3705 (diff)
downloadnextcloud-server-6857136f06190acad26a4dfc541c9c688aa75014.tar.gz
nextcloud-server-6857136f06190acad26a4dfc541c9c688aa75014.zip
fixes missing prefix to validate password reset token
- also fixes the test which missed asserting the presence of it Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/LostController.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index cee3837ac5a..a8c459a32e1 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -172,7 +172,8 @@ class LostController extends Controller {
*/
protected function checkPasswordResetToken(string $token, string $userId): void {
try {
- $this->verificationToken->check($token, $this->userManager->get($userId), 'lostpassword', '', true);
+ $user = $this->userManager->get($userId);
+ $this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true);
} catch (InvalidTokenException $e) {
$error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED
? $this->l10n->t('Could not reset password because the token is expired')