|
@@ -155,8 +155,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
.anyRequest().authenticated()
|
|
|
.and().csrf().disable()
|
|
|
.authorizeRequests().antMatchers("/login", "/logout", "/favicon.ico", "/error", "/file/**").permitAll()
|
|
|
-// .and().addFilterBefore(jwtAuthenticationTokenFilter, SessionManagementFilter.class);
|
|
|
- .and().addFilter(jwtAuthenticationTokenFilter);
|
|
|
+ .and().addFilterBefore(jwtAuthenticationTokenFilter, SessionManagementFilter.class);
|
|
|
|
|
|
http
|
|
|
.formLogin().successHandler(new RestAuthenticationSuccessHandler())
|
|
@@ -164,10 +163,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
.permitAll()
|
|
|
.and()
|
|
|
.logout().logoutSuccessHandler(new RestLogoutSuccessHandler())
|
|
|
-// .deleteCookies("JSESSIONID", "JWT_TOKEN")
|
|
|
+ .deleteCookies("JSESSIONID", "JWT_TOKEN")
|
|
|
.permitAll();
|
|
|
//session 管理
|
|
|
-// http.sessionManagement().maximumSessions(5);
|
|
|
+ http.sessionManagement().maximumSessions(5);
|
|
|
|
|
|
http.exceptionHandling().authenticationEntryPoint(new RestAuthenticationEntryPoint());
|
|
|
|
|
@@ -257,7 +256,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
throws IOException, ServletException {
|
|
|
|
|
|
logger.info("登出成功! ");
|
|
|
- HttpUtil.delCookies(request, response, cookieName);
|
|
|
+ HttpUtil.delCookies(request, response, "JSESSIONID", cookieName);
|
|
|
HttpUtil.ok(request, response);
|
|
|
|
|
|
}
|