fichier langue / bootstrap

This commit is contained in:
mepiphana2023
2024-04-24 11:19:28 +02:00
parent 86bcf8c022
commit 067920189f
5 changed files with 59 additions and 46 deletions

View File

@@ -16,7 +16,7 @@ public class WebConfig {
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver resolver = new SessionLocaleResolver();
resolver.setDefaultLocale(Locale.FRENCH); // Définit la locale par défaut
resolver.setDefaultLocale(Locale.FRENCH);
return resolver;
}

View File

@@ -19,7 +19,7 @@ public class WebSecurityConfig{
.requestMatchers("/", "/accueil").permitAll()
.requestMatchers("/accueil", "/login", "/inscription/**", "/searchArticle", "/article/**", "/change-language").permitAll()
.requestMatchers("/css/**", "/images/**", "/assets/**", "/img/**", "/js/**").permitAll()
.requestMatchers("/profil/**", "/article/new/**", "/article/update", "/article/delete").authenticated()
.requestMatchers("/profil/**", "/article/new/**").authenticated()
.requestMatchers("/admin").hasRole("ADMIN")
.anyRequest().authenticated())
.formLogin((form) -> form.loginPage("/login").defaultSuccessUrl("/", true))