| 172 | // structure is to avoid unnecessarily executing subsequent functions if previous ones fail in the |
| 173 | // conditional statement below, as a developer may decide to execute expensive operations in them |
| 174 | const verifyUserEmails = async () => req.config.verifyUserEmails === true || (typeof req.config.verifyUserEmails === 'function' && await Promise.resolve(req.config.verifyUserEmails(request)) === true); |
| 175 | const preventLoginWithUnverifiedEmail = async () => req.config.preventLoginWithUnverifiedEmail === true || (typeof req.config.preventLoginWithUnverifiedEmail === 'function' && await Promise.resolve(req.config.preventLoginWithUnverifiedEmail(request)) === true); |
| 176 | if (await verifyUserEmails() && await preventLoginWithUnverifiedEmail() && !user.emailVerified) { |
| 177 | throw new Parse.Error(Parse.Error.EMAIL_NOT_FOUND, 'User email is not verified.'); |