-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 검증 로직 수정 및 로그아웃 구현 #11
New issue
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
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.
테스트 한글 외에 큰 이견 없습니다 해당 부분은 적용이 필요하다고 생각하면 바꿔주세요!
테스트 익숙하지 않으셨을텐데 잘 작성해주셨네요 고생 많으셨습니다👍
| fun logout(response: HttpServletResponse) { | ||
| refreshTokenCookieSupporter.expireRefreshTokenCookie(response) |
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.
HttpServletResponse에 값을 심어주는 건 Controller에서 하는게 좋지 않을까요?
| // /auth/reissue 엔드포인트가 쿠키를 받아 TokenResponse, 헤더를 정상 반환하는지 검증 | ||
| fun reissue_returns_tokenResponse_and_sets_cookie_header(){ |
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.
fun 쿠키를_받아_response에_정상적으로_반환한다 이렇게 한글로 테스트명 표기해도 괜찮을 거 같아요~
한글 시작점과 끝점 사이에 백틱 '`' 사용하시면 돼요
|
|
||
| @WebMvcTest(AuthController::class) | ||
| @AutoConfigureMockMvc(addFilters = false) | ||
| class AuthControllerReissueTest { |
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.
단위 테스트 좋습니다~ 실제 작동을 테스트하는 E2E 테스트는 조금 익숙해지면 해도 좋을 것 같아요
📄 작업 내용
인증 플로우
/auth/login: OAuth2 성공 시 refreshToken을 쿠키로 설정하고 /auth/callback으로 리다이렉트콜백 후
/auth/reissue호출 시 쿠키에 담긴 refreshToken으로 accessToken을 재발급하고, accessToken만 body로 반환accessToken 만료 시
/auth/reissue로 재발급/auth/logout호출 시 refreshToken 쿠키를 즉시 만료시킴RefreshTokenCookieSupporter로 쿠키 발급, 삭제 로직 분리
테스트코드 작성
close #10