Keep error and error_description query params in login url.

Signed-off-by: vramik <vramik@redhat.com>
This commit is contained in:
vramik 2024-10-29 10:07:31 +01:00 committed by Pedro Igor
parent 77231bd68c
commit 7368104e43

View file

@ -247,6 +247,18 @@ public class AccountConsole implements AccountResourceProvider {
.queryParam(OAuth2Constants.CODE_CHALLENGE, pkceChallenge)
.queryParam(OAuth2Constants.CODE_CHALLENGE_METHOD, OAuth2Constants.PKCE_METHOD_S256);
if (!queryParameters.isEmpty()) {
String error = queryParameters.getFirst(OAuth2Constants.ERROR);
if (error != null) {
uriBuilder.queryParam(OAuth2Constants.ERROR, error);
String errorDescription = queryParameters.getFirst(OAuth2Constants.ERROR_DESCRIPTION);
if (errorDescription != null) {
uriBuilder.queryParam(OAuth2Constants.ERROR_DESCRIPTION, errorDescription);
}
}
}
URI url = uriBuilder.build();
return Response.status(302).location(url).build();