File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,6 @@ export class UsersRouter extends ClassesRouter {
103103 user = results [ 0 ] ;
104104 }
105105
106- if ( req . config . verifyUserEmails && req . config . preventLoginWithUnverifiedEmail && ! user . emailVerified ) {
107- throw new Parse . Error ( Parse . Error . EMAIL_NOT_FOUND , 'User email is not verified.' ) ;
108- }
109106 return passwordCrypto . compare ( password , user . password ) ;
110107 } )
111108 . then ( ( correct ) => {
@@ -117,7 +114,9 @@ export class UsersRouter extends ClassesRouter {
117114 if ( ! isValidPassword ) {
118115 throw new Parse . Error ( Parse . Error . OBJECT_NOT_FOUND , 'Invalid username/password.' ) ;
119116 }
120-
117+ if ( req . config . verifyUserEmails && req . config . preventLoginWithUnverifiedEmail && ! user . emailVerified ) {
118+ throw new Parse . Error ( Parse . Error . EMAIL_NOT_FOUND , 'User email is not verified.' ) ;
119+ }
121120 // handle password expiry policy
122121 if ( req . config . passwordPolicy && req . config . passwordPolicy . maxPasswordAge ) {
123122 let changedAt = user . _password_changed_at ;
You can’t perform that action at this time.
0 commit comments