Skip to content

Commit

Permalink
sonar bug (#1011)
Browse files Browse the repository at this point in the history
* removed validate-request audits

* removed initial audits from controllers

* fixed audit and logger

* fixed debug logs

* fixed logger

* fixed audit and logger

* removed audits from test classes

* fixed one exception

* fixed sonar bug

---------

Co-authored-by: Ritik Jain <[email protected]>
  • Loading branch information
RitikJain4108 and Ritik Jain authored Jul 17, 2023
1 parent 1ec43a6 commit eb3aba1
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,17 @@ public Tuple2<Boolean, ResidentTransactionEntity> validateOtpV2(String transacti
response.getErrors().get(0).getErrorMessage(), Map.of(ResidentConstants.EVENT_ID, eventId));
}
if (response.getErrors().get(0).getErrorCode().equals(ResidentConstants.OTP_AUTH_LOCKED_ERR_CODE)) {
if (authType.equals(ResidentConstants.PHONE)) {
throw new OtpValidationFailedException(ResidentErrorCode.SMS_AUTH_LOCKED.getErrorCode(),
ResidentErrorCode.SMS_AUTH_LOCKED.getErrorMessage(),
Map.of(ResidentConstants.EVENT_ID, eventId));
}
if (authType.equals(ResidentConstants.EMAIL)) {
throw new OtpValidationFailedException(ResidentErrorCode.EMAIL_AUTH_LOCKED.getErrorCode(),
ResidentErrorCode.EMAIL_AUTH_LOCKED.getErrorMessage(),
Map.of(ResidentConstants.EVENT_ID, eventId));
}
if (authType != null) {
if (authType.equals(ResidentConstants.PHONE)) {
throw new OtpValidationFailedException(ResidentErrorCode.SMS_AUTH_LOCKED.getErrorCode(),
ResidentErrorCode.SMS_AUTH_LOCKED.getErrorMessage(),
Map.of(ResidentConstants.EVENT_ID, eventId));
}
if (authType.equals(ResidentConstants.EMAIL)) {
throw new OtpValidationFailedException(ResidentErrorCode.EMAIL_AUTH_LOCKED.getErrorCode(),
ResidentErrorCode.EMAIL_AUTH_LOCKED.getErrorMessage(),
Map.of(ResidentConstants.EVENT_ID, eventId));
}
boolean containsPhone = authType.contains(ResidentConstants.PHONE);
boolean containsEmail = authType.contains(ResidentConstants.EMAIL);
if (containsPhone && containsEmail) {
Expand Down

0 comments on commit eb3aba1

Please sign in to comment.