Fix type checking in password reset controller (#7042)

Lifted from #6942

Fixes #6927
This commit is contained in:
Rijk van Zanten
2021-07-28 18:08:18 +02:00
committed by GitHub
parent ff576a0b6e
commit 6da9524413

View File

@@ -190,11 +190,11 @@ router.post(
router.post(
'/password/reset',
asyncHandler(async (req, res, next) => {
if (req.body.token !== 'string') {
if (typeof req.body.token !== 'string') {
throw new InvalidPayloadException(`"token" field is required.`);
}
if (req.body.password !== 'string') {
if (typeof req.body.password !== 'string') {
throw new InvalidPayloadException(`"password" field is required.`);
}