Repository navigation
[FE] 만료 토큰의 400 응답도 세션 만료로 처리 (#509) - #411
Merged
Merged
Conversation
인터셉터가 401 만 세션 만료로 봤는데, 백엔드는 만료·무효 토큰에 400 을 준다. 정작 진짜 만료 케이스에서 다이얼로그가 안 뜨고 일반 에러로 새고 있었다. api.gitanimals.org 실측 (2026-09-04): Authorization 헤더 없음 → 401 "Required request header 'Authorization' ... is not present" 만료·무효 토큰 → 400 "Authorization fail" - isAuthFailureResponse 로 401 과 400 "Authorization fail" 을 함께 인증 실패로 본다 - 메시지까지 보므로 평범한 400 은 그대로 통과한다 - 판정 함수는 sessionExpired.ts 에 둔다. interceptor.ts 는 모듈 최상위에서 react 의 cache() 를 호출해 node 테스트 환경에서 import 가 안 된다 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMdPChPLYGeqjok2W3kbCA
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💻 작업 내용
토큰이 만료되면 세션 만료 다이얼로그가 뜨지 않고 일반 에러로 새던 문제를 고칩니다. 인터셉터가 401만 세션 만료로 봤는데, 백엔드는 만료 토큰에 400을 줍니다. gitanimals#509 의 남은 절반입니다.
실측 (api.gitanimals.org, 2026-09-04):
Authorization헤더 없음401 {"message":"Required request header 'Authorization' ... is not present"}400 {"message":"Authorization fail"}이슈에 첨부된 콘솔의
api.gitanimals.org/inboxes → 400이 정확히 두 번째 경우입니다.주요 변경
isAuthFailureResponse로 401과 400Authorization fail을 함께 인증 실패로 판정합니다invalid personaId등)은 그대로 통과합니다 — 엉뚱한 요청 실패에 세션 만료 다이얼로그가 뜨지 않습니다sessionExpired.ts에 뒀습니다.interceptor.ts는 모듈 최상위에서 react 의cache()를 호출해 node 테스트 환경에서 import 자체가 안 됩니다📸 스크린샷
동작 변화는 다이얼로그 노출 여부뿐이라 UI 변경 없음.