Handled non-existent user login error

This commit is contained in:
rajesh
2026-03-05 15:42:03 +05:30
parent 7d6c55cf92
commit 4726cd5104
4 changed files with 6 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ public class AuthenticationService {
RoleStatusEnum.ROLE_BENEFICIARY.getValue()
).orElseThrow(() -> new ResourceNotFoundException(
Status.NOT_FOUND,
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG)
Translator.toLocale(GepafinConstant.INVALID_USERNAME_AND_PASSWORD)
));
String emailWithHubId = loginReq.getEmail()+":"+loginReq.getHubUuid();
@@ -115,7 +115,7 @@ public class AuthenticationService {
createSuccessLoginAttempt(loginAttemptEntity);
} catch (Exception e) {
log.info("Authentication failed for email: {}", loginReq.getEmail());
loginAttemptEntity.setUserId(user.getId());
// loginAttemptEntity.setUserId(user.getId());
createFailedLoginAttempt(loginAttemptEntity, e.getMessage());
throw e;
}
@@ -238,7 +238,7 @@ public class AuthenticationService {
return getJWTTokenBean(userEntity, Boolean.TRUE, loginAttempt.getId(),null);
} catch (Exception e) {
log.info("Authentication login failed for email: {}",e.getMessage());
loginAttemptEntity.setUserId(userId);
// loginAttemptEntity.setUserId(userId);
createFailedLoginAttempt(loginAttemptEntity, e.getMessage());
throw e;
}