diff --git a/images/DemoGif.gif b/images/DemoGif.gif deleted file mode 100644 index 5413bd36..00000000 Binary files a/images/DemoGif.gif and /dev/null differ diff --git a/images/login-dark.png b/images/login-dark.png index 1ec28686..0453e7b9 100644 Binary files a/images/login-dark.png and b/images/login-dark.png differ diff --git a/images/login-light.png b/images/login-light.png index e310e5bf..6b5b66a5 100644 Binary files a/images/login-light.png and b/images/login-light.png differ diff --git a/images/settings-light.png b/images/settings-light.png new file mode 100644 index 00000000..79d52330 Binary files /dev/null and b/images/settings-light.png differ diff --git a/images/settings.png b/images/settings.png deleted file mode 100644 index e2e75fb8..00000000 Binary files a/images/settings.png and /dev/null differ diff --git a/images/stirling-home-dark.png b/images/stirling-home-dark.png new file mode 100644 index 00000000..09c7f905 Binary files /dev/null and b/images/stirling-home-dark.png differ diff --git a/images/stirling-home-light.png b/images/stirling-home-light.png deleted file mode 100644 index e5b53026..00000000 Binary files a/images/stirling-home-light.png and /dev/null differ diff --git a/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java b/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java index 3c8efd3c..09553f81 100644 --- a/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java +++ b/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java @@ -58,7 +58,8 @@ public class CleanUrlInterceptor implements HandlerInterceptor { // Redirect to the URL with only allowed query parameters String redirectUrl = requestURI + "?" + newQueryString; - response.sendRedirect(redirectUrl); + + response.sendRedirect(request.getContextPath() + redirectUrl); return false; } } diff --git a/src/main/java/stirling/software/SPDF/config/security/CustomAuthenticationFailureHandler.java b/src/main/java/stirling/software/SPDF/config/security/CustomAuthenticationFailureHandler.java index 02911622..5a768f9f 100644 --- a/src/main/java/stirling/software/SPDF/config/security/CustomAuthenticationFailureHandler.java +++ b/src/main/java/stirling/software/SPDF/config/security/CustomAuthenticationFailureHandler.java @@ -42,9 +42,11 @@ public class CustomAuthenticationFailureHandler extends SimpleUrlAuthenticationF String ip = request.getRemoteAddr(); logger.error("Failed login attempt from IP: {}", ip); + String contextPath = request.getContextPath(); + if (exception.getClass().isAssignableFrom(InternalAuthenticationServiceException.class) || "Password must not be null".equalsIgnoreCase(exception.getMessage())) { - response.sendRedirect("/login?error=oauth2AuthenticationError"); + response.sendRedirect(contextPath + "/login?error=oauth2AuthenticationError"); return; } @@ -59,13 +61,13 @@ public class CustomAuthenticationFailureHandler extends SimpleUrlAuthenticationF loginAttemptService.loginFailed(username); if (loginAttemptService.isBlocked(username) || exception.getClass().isAssignableFrom(LockedException.class)) { - response.sendRedirect("/login?error=locked"); + response.sendRedirect(contextPath + "/login?error=locked"); return; } } if (exception.getClass().isAssignableFrom(BadCredentialsException.class) || exception.getClass().isAssignableFrom(UsernameNotFoundException.class)) { - response.sendRedirect("/login?error=badcredentials"); + response.sendRedirect(contextPath + "/login?error=badcredentials"); return; } diff --git a/src/main/java/stirling/software/SPDF/config/security/FirstLoginFilter.java b/src/main/java/stirling/software/SPDF/config/security/FirstLoginFilter.java index 5936ea3f..213fd2f8 100644 --- a/src/main/java/stirling/software/SPDF/config/security/FirstLoginFilter.java +++ b/src/main/java/stirling/software/SPDF/config/security/FirstLoginFilter.java @@ -44,7 +44,7 @@ public class FirstLoginFilter extends OncePerRequestFilter { && user.isPresent() && user.get().isFirstLogin() && !"/change-creds".equals(requestURI)) { - response.sendRedirect("/change-creds"); + response.sendRedirect(request.getContextPath() + "/change-creds"); return; } }