У меня проблема с выходом из системы на моей странице.
После того, как вы вышли из системы, я не знаю, почему вы снова заходите на сайт. Повар ie будет удален, и будет создан новый повар ie.
Spring Security Config:
@Configuration
@EnableWebSecurity(debug = true)
@EnableJpaRepositories(basePackageClasses = UserRepository.class)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Qualifier("myUserDetailsService")
@Autowired
UserDetailsService userDetailsService;
private final SimpleAuthenticationSuccessHandler simpleAuthenticationSuccessHandler;
@Autowired
public SecurityConfiguration(SimpleAuthenticationSuccessHandler simpleAuthenticationSuccessHandler) {
this.simpleAuthenticationSuccessHandler = simpleAuthenticationSuccessHandler;
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/admin/**").hasAnyAuthority("ADMIN")
.antMatchers("/user").hasAnyAuthority("ADMIN", "USER")
.antMatchers("/addUser", "/").permitAll()
.anyRequest().authenticated().and().httpBasic().and().logout().logoutUrl("/logout").invalidateHttpSession(true).deleteCookies("JSESSIONID").logoutSuccessUrl("/");
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}
Код:
https://github.com/lakomika/Shop
Вы видите, почему это происходит?