Skip to content

Commit

Permalink
Change to lower case the message from the response
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo04 committed Aug 11, 2021
1 parent 186b036 commit db7366a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public static AuthException exceptionForStatusCode(int statusCode, Throwable cau
case 401:
// Code 401 can be obtain because credentials are wrong or the user's password has been compromised
// To differentiate both responses, we check the response's body
if (cause != null && Objects.equals(cause.getMessage(), COMPROMISED_PASSWORD_BODY)) {
String message = cause != null && cause.getMessage() != null ? cause.getMessage().toLowerCase() : "";
if (Objects.equals(message, COMPROMISED_PASSWORD_BODY)) {
return new AuthException(FailureType.COMPROMISED_PASSWORD, COMPROMISED_PASSWORD_MESSAGE, cause);
}
default:
Expand Down

0 comments on commit db7366a

Please sign in to comment.