-
Notifications
You must be signed in to change notification settings - Fork 7
[BE] refactor: logout 및 reissueRefreshToken 요청시 리프래시 토큰이 없는 경우 추가 핸들링 #571
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refresh에서 탈출합시다..
@@ -25,7 +25,7 @@ public void addInterceptors(final InterceptorRegistry registry) { | |||
|
|||
registry.addInterceptor(new AuthInterceptor(jwtTokenProvider)) | |||
.addPathPatterns("/member/**", "/writings/**", "/categories/**", "/trash/**", "/connections/**", "/auth/**") | |||
.excludePathPatterns("/connections/**/redirect", "/auth/login/**", "/auth/token/refresh") | |||
.excludePathPatterns("/connections/**/redirect", "/auth/login/**", "/auth/token/refresh", "/auth/logout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이제 확인했는데 여기 /connections/**/redirect
면 tistory랑 notion도 해당될 거 같은데 이렇게 의도된게 맞나요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirect할 때에 경로들인 것으로 확인했습니다. 해당 인터셉터는 AuthInterceptor로, AccessToken(JWT)를 확인하는 인터셉터이므로 빠진 제외시킨 것 같고, 문제 없을 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다....
@Test | ||
@DisplayName("쿠키에 리프레시 토큰이 없더라도, 로그아웃시 정상적으로 200 상태를 반환한다.") | ||
void logout_without_refreshToken() throws Exception { | ||
mockMvc.perform( | ||
post("/auth/logout").contentType(MediaType.APPLICATION_JSON) | ||
|
||
) | ||
.andExpect(status().isOk()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
멋진데요?👍
if (Objects.isNull(refreshToken)) { | ||
throw new ExpiredRefreshTokenException(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
검증로직은 메서드로 빼면 깔끔할거같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵!!
🛠️ Issue
✅ Tasks
⏰ Time Difference
📝 Note