Dae-Hyun Kim
@hdevkim5851
Reviews Written
-
Average Rating
-
Posts
Q&A
๋์์ธ์ ์ ์ด ๊ธฐ๋ฅ์์ ๋ก๊ทธ์์ํ๊ธฐ
๋ค์๋ณด๋ ๊ฐ์ฌ๋๊ป์ ์ด๋ฏธ ๋ต๋ณํ์ ๋ด์ฉ์ด๋ค์ ^^ https://www.inflearn.com/community/questions/40072/๋์-์ธ์ -์ ์ด-๋์ผ-๋ธ๋ผ์ฐ์ ์์-๋ก๊ทธ์์์ด-์ ์ฑ -๋ฏธ์ ์ฉ
- 0
- 3
- 124
Q&A
๋์์ธ์ ์ ์ด ๊ธฐ๋ฅ์์ ๋ก๊ทธ์์ํ๊ธฐ
@GetMapping(value = "/api/logout") public String logout(HttpServletRequest request, HttpServletResponse response) { Authentication authentication = SecurityContextHolder.getContextHolderStrategy().getContext().getAuthentication(); if (authentication != null) { new SecurityContextLogoutHandler().logout(request, response, authentication); } return "logout"; }์ ์ฝ๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.์ ์ ๊ตฌ๊ธ๋ง์ ํด๋ณด๋@Bean public static ServletListenerRegistrationBean httpSessionEventPublisher() { return new ServletListenerRegistrationBean(new HttpSessionEventPublisher()); }์ด๋ ๊ฒ HttpSessionEventPublisher๋ฅผ ๋ฑ๋กํ๋ฉด SeesionRegistry๊ฐ ์ด๋ฒคํธ๋ฅผ ๊ฐ์งํ์ฌ onApplicationEvent()์์ removeSessionInformation()์ ํธ์ถํ๋ค๊ณ ํ์ฌ ํ ์คํธ ํด๋ณด๋ ๋ก๊ทธ์์์ ์ ๋์ํ๋ค์
- 0
- 3
- 124




