You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// !user.passwordResetCode avoids the situation where passwordResetCode has not been sent (null), but user posts null to API
488
-
if(!user||!user.passwordResetCode){
489
-
returnres.badRequest('Invalid email, password or password reset code.');
509
+
if(
510
+
!user||
511
+
!user.passwordResetCode||
512
+
!cachedResetCode||
513
+
user.passwordResetCode!==cachedResetCode
514
+
){
515
+
returnres.badRequest(
516
+
"Invalid email, password or password reset code."
517
+
);
490
518
}
491
519
492
520
user.password=password;// Hash is created by the model hooks
493
-
user.passwordResetCode=true;// Model will generate new code so that old code cannot be used again - https://github.com/citizenos/citizenos-api/issues/68
0 commit comments