From a812fcede8f88aed71c6c0b43d81d494b3d3fb8e Mon Sep 17 00:00:00 2001 From: Pedro Rivas Date: Sat, 22 Feb 2025 02:13:38 +0100 Subject: [PATCH] Add permissions to public assets --- .../infrastructure/primary/SecurityConfiguration.java.mustache | 3 +++ .../infrastructure/primary/SecurityConfiguration.java.mustache | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/resources/generator/server/springboot/mvc/security/jwt/authentication/main/infrastructure/primary/SecurityConfiguration.java.mustache b/src/main/resources/generator/server/springboot/mvc/security/jwt/authentication/main/infrastructure/primary/SecurityConfiguration.java.mustache index fd46970e1a0..b924db8ff91 100644 --- a/src/main/resources/generator/server/springboot/mvc/security/jwt/authentication/main/infrastructure/primary/SecurityConfiguration.java.mustache +++ b/src/main/resources/generator/server/springboot/mvc/security/jwt/authentication/main/infrastructure/primary/SecurityConfiguration.java.mustache @@ -67,6 +67,9 @@ class SecurityConfiguration { .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authorizeHttpRequests(authz -> authz .requestMatchers(antMatcher(HttpMethod.OPTIONS, "/**")).permitAll() + .requestMatchers(antMatcher("/index.html")).permitAll() + .requestMatchers(antMatcher("/")).permitAll() + .requestMatchers(antMatcher("/assets/**")).permitAll() .requestMatchers(antMatcher("/app/**")).permitAll() .requestMatchers(antMatcher("/i18n/**")).permitAll() .requestMatchers(antMatcher("/content/**")).permitAll() diff --git a/src/main/resources/generator/server/springboot/mvc/security/oauth2/core/main/infrastructure/primary/SecurityConfiguration.java.mustache b/src/main/resources/generator/server/springboot/mvc/security/oauth2/core/main/infrastructure/primary/SecurityConfiguration.java.mustache index d0068515c2b..cccdff206b6 100644 --- a/src/main/resources/generator/server/springboot/mvc/security/oauth2/core/main/infrastructure/primary/SecurityConfiguration.java.mustache +++ b/src/main/resources/generator/server/springboot/mvc/security/oauth2/core/main/infrastructure/primary/SecurityConfiguration.java.mustache @@ -77,6 +77,9 @@ class SecurityConfiguration { ) .authorizeHttpRequests(authz -> authz .requestMatchers(antMatcher(HttpMethod.OPTIONS, "/**")).permitAll() + .requestMatchers(antMatcher("/index.html")).permitAll() + .requestMatchers(antMatcher("/")).permitAll() + .requestMatchers(antMatcher("/assets/**")).permitAll() .requestMatchers(antMatcher("/app/**")).permitAll() .requestMatchers(antMatcher("/i18n/**")).permitAll() .requestMatchers(antMatcher("/content/**")).permitAll()