Skip to content

Commit

Permalink
fix(jans-auth-server): fixed error code during error response creation
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Feb 10, 2022
1 parent d8f2ea9 commit 0d47490
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,15 @@ private ErrorResponse createErrorResponseFromRedirectErrorUri(@NotNull URI locat

final ErrorResponse response = new ErrorResponse();

String error = locationRedirect.getResponseParameter("error");
String errorDescription = locationRedirect.getResponseParameter("error_description");
errorDescription = Optional.ofNullable(errorDescription)
.map(description -> Optional.ofNullable(ThreadContext.get(Constants.CORRELATION_ID_HEADER))
.map(id -> description.concat(" CorrelationId: " + id))
.orElse(description))
.orElse(null);

response.setErrorCode(errorDescription);
response.setErrorCode(error);
response.setErrorDescription(errorDescription);
return response;
}
Expand Down

0 comments on commit 0d47490

Please sign in to comment.