We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
소셜 로그인은 잘 수행되지만 로그아웃이 수행되지 않습니다.
컨트롤러 매핑 메소드에 accessToken을 전달하지 않고 있습니다.
기존에는 LogoutInterceptor에 의해서 컨트롤러 전달전에 Authorization 헤더에서 accessToken을 파싱하여 RequestAttribute로 설정하였지만 security 라이브러리 도입 과정에서 설정이 빠진 것을 확인하였습니다.
LogoutInterceptor를 설정에 추가합니다.
@Slf4j public class LogoutInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { log.debug("로그아웃 인터셉터 접속 : {}", request.getRequestURI()); String accessToken = extractJwt(request).orElseThrow( () -> new UnAuthorizationException(JwtErrorCode.EMPTY_TOKEN)); request.setAttribute("accessToken", accessToken); return true; } private Optional<String> extractJwt(HttpServletRequest request) { String header = request.getHeader(AUTHORIZATION); if (!StringUtils.hasText(header) || !header.startsWith(BEARER)) { return Optional.empty(); } return Optional.of(header.split(" ")[1]); } }
The text was updated successfully, but these errors were encountered:
#29 fix: logout interceptor 설정 추가
6e1bf7f
- 로그아웃 인터셉터를 추가하여 컨트롤러 매핑 메소드 전달전에 Authorization 헤더에서 accessToken을 추출하여 RequestAttribute에 저장하도록 처리합니다.
#29 fix: logout interceptor 설정 추가 (#30)
f44d012
yonghwankim-dev
Successfully merging a pull request may close this issue.
상황
소셜 로그인은 잘 수행되지만 로그아웃이 수행되지 않습니다.
원인
컨트롤러 매핑 메소드에 accessToken을 전달하지 않고 있습니다.
기존에는 LogoutInterceptor에 의해서 컨트롤러 전달전에 Authorization 헤더에서 accessToken을 파싱하여 RequestAttribute로 설정하였지만 security 라이브러리 도입 과정에서 설정이 빠진 것을 확인하였습니다.
해결방법
LogoutInterceptor를 설정에 추가합니다.
The text was updated successfully, but these errors were encountered: