fichier langue / bootstrap

This commit is contained in:
mepiphana2023
2024-04-24 12:15:04 +02:00
parent 3faaeffa70
commit 666416d2f3
6 changed files with 172 additions and 166 deletions

View File

@@ -22,10 +22,15 @@ public class WebSecurityConfig{
.requestMatchers("/profil/**", "/article/new/**", "/article/update", "/article/delete").authenticated()
.requestMatchers("/admin").hasRole("ADMIN")
.anyRequest().authenticated())
.formLogin((form) -> form.loginPage("/login").defaultSuccessUrl("/", true))
.logout((logout) -> logout.clearAuthentication(true).invalidateHttpSession(true)
.deleteCookies("JSESSIONID").logoutSuccessUrl("/logout")
.logoutRequestMatcher(new AntPathRequestMatcher("/logout")).permitAll());
.formLogin((form) -> form
.loginPage("/login")
.defaultSuccessUrl("/", true))
.logout((logout) -> logout
.logoutUrl("/logout")
.logoutSuccessUrl("/accueil") // Redirection après déconnexion
.invalidateHttpSession(true)
.clearAuthentication(true)
.deleteCookies("JSESSIONID"));
return http.build();
}