We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39b80e4 commit adfe789Copy full SHA for adfe789
1 file changed
backend/src/main/java/org/example/app/general/common/security/AuthCookieFilter.java
@@ -33,10 +33,10 @@ public void filter(ContainerRequestContext requestContext) throws IOException {
33
34
if (!isValidSession(sessionCookie.getValue())) {
35
sessionService.storeSession(sessionCookie.getValue(), "", originalUrl);
36
- // Redirect to Keycloak if no valid session found
37
requestContext.abortWith(
38
- Response.status(Response.Status.FOUND)
39
- .header("Location", authRedirectUrl)
+ Response.status(Response.Status.UNAUTHORIZED)
+ .entity("{\"redirectUrl\": \"" + authRedirectUrl + "\"}")
+ .type(MediaType.APPLICATION_JSON)
40
.build()
41
);
42
}
0 commit comments