fix(api-server): check type of email to prevent throw (#50259)

This commit is contained in:
Shaun Hamilton
2023-05-03 13:53:28 +01:00
committed by GitHub
parent 8094d0892a
commit e30e6d9f55

View File

@@ -220,7 +220,7 @@ function mobileLogin(app) {
const { email } = await auth0Res.json();
if (!isEmail(email)) {
if (typeof email !== 'string' || !isEmail(email)) {
return next(
wrapHandledError(new TypeError('decoded email is invalid'), {
type: 'danger',