Handled non-existent user login error
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user