fix(core): Password reset should pass in the correct values to external hooks (#5842)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-03-30 16:44:39 +02:00
committed by GitHub
parent d0788ee8e1
commit 5bcab8fcbe
2 changed files with 14 additions and 2 deletions

View File

@@ -255,8 +255,10 @@ export class PasswordResetController {
throw new NotFoundError('');
}
const passwordHash = await hashPassword(validPassword);
await this.userRepository.update(userId, {
password: await hashPassword(validPassword),
password: passwordHash,
resetPasswordToken: null,
resetPasswordTokenExpiration: null,
});
@@ -279,6 +281,6 @@ export class PasswordResetController {
});
}
await this.externalHooks.run('user.password.update', [user.email, password]);
await this.externalHooks.run('user.password.update', [user.email, passwordHash]);
}
}