Update code

This commit is contained in:
harish
2024-08-27 12:40:49 +05:30
parent 83e7c898bd
commit 38d806dc39
3 changed files with 9 additions and 2 deletions

View File

@@ -181,6 +181,10 @@ public class UserDao {
log.info("Password reset attempt for non-existent user: {}", resetPasswordReq.getEmail());
throw new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG));
}
if (!resetPasswordReq.getNewPassword().equals(resetPasswordReq.getConfirmPassword())) {
log.info("User creation failed: Passwords do not match for email {}", user.getEmail());
throw new CustomValidationException(Status.VALIDATION_ERROR, Translator.toLocale(GepafinConstant.PASSWORD_DOESNT_MATCH));
}
String dbToken = user.getResetPasswordToken();
if (dbToken == null || !dbToken.equals(resetPasswordReq.getToken())) {