This commit is contained in:
Dario Ghunney Ware 2025-09-08 12:15:56 +01:00
parent 9d535ed7a5
commit 0ac593bad3

View File

@ -62,9 +62,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
protected void doFilterInternal(
HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
validateAndNormalizeJwtSettings();
if (!jwtService.isJwtEnabled()) {
if (!validateAndNormalizeJwtSettings() && !jwtService.isJwtEnabled()) {
filterChain.doFilter(request, response);
return;
}
@ -114,7 +112,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
filterChain.doFilter(request, response);
}
private void validateAndNormalizeJwtSettings() {
private boolean validateAndNormalizeJwtSettings() {
ApplicationProperties.Security.Jwt jwtProperties = securityProperties.getJwt();
boolean enableKeystore = jwtProperties.isEnableKeystore();
@ -137,7 +135,11 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
jwtProperties.setEnableKeyRotation(false);
jwtProperties.setEnableKeyCleanup(false);
jwtProperties.setSecureCookie(false);
return false;
}
return true;
}
private boolean apiKeyExists(HttpServletRequest request, HttpServletResponse response)