Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
걸어가기공개 및 인증된 API 호출을 구분하기 위해 새로운 API 헬퍼를 추가하고 기존 함수 호출을 업데이트했습니다. 비회원 메시지 작성 시 불필요한 인증 토큰 전송 문제를 해결합니다. 변경 사항
예상 코드 검토 노력🎯 2 (Simple) | ⏱️ ~10 분
시
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
✨ Storybook: 🔗 https://690458540424857aa71aec97-qtebydbuch.chromatic.com/ |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/lib/api.ts (1)
25-37: 인증 체크용 함수의 동작 방식을 확인하세요.
apiGetAuthCheck는skipAuthRedirect: "true"헤더를 포함하지만withCredentials: false를 설정하지 않습니다. 즉, 이 함수는 여전히 인증 정보(쿠키, Authorization 헤더)를 포함하여 요청을 보내지만, 인증 실패 시 자동 리다이렉트를 방지합니다.
apiGetPublic(lines 11-23)과의 차이점:
apiGetAuthCheck: 인증된 요청이지만 실패 시 리다이렉트 스킵apiGetPublic: 비인증 요청 (withCredentials: false포함)함수 이름과 주석이 이러한 의미 차이를 명확히 전달하는지 확인해주세요.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/apis/board.ts(2 hunks)src/apis/message.ts(1 hunks)src/lib/api.ts(2 hunks)src/stores/useAuthStore.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/stores/useAuthStore.ts (1)
src/apis/board.ts (1)
getBoardShareForAuth(37-40)
src/apis/board.ts (3)
src/types/board.ts (1)
GetBoardShareResponse(12-17)src/lib/api.ts (1)
apiGetAuthCheck(26-37)src/apis/config/endpoints.ts (1)
API_ENDPOINTS(1-33)
src/apis/message.ts (2)
src/types/message.ts (1)
MessageData(1-12)src/lib/api.ts (1)
apiPostPublic(47-58)
🔇 Additional comments (4)
src/lib/api.ts (1)
47-58: LGTM! 비회원 API 호출을 위한 올바른 구현입니다.
apiPostPublic함수가skipAuthRedirect: "true"및withCredentials: false를 모두 설정하여 비회원 요청에서 Authorization 헤더를 제거합니다. 이는 PR 목표와 정확히 일치합니다.src/apis/message.ts (1)
2-2: ✅ 핵심 수정사항 - 비회원 메시지 작성 API 수정 완료
apiPost에서apiPostPublic으로 변경하여 비회원 메시지 작성 시 Authorization 헤더가 포함되지 않도록 수정했습니다. 이는 issue #135에서 보고된 토큰 재발급 및 리다이렉트 오류를 해결합니다.
apiPostPublic은withCredentials: false를 설정하여 인증 정보를 보내지 않으므로, 비회원 사용자가 메시지를 작성할 때 의도한 대로 동작합니다.Also applies to: 8-11
src/stores/useAuthStore.ts (1)
2-2: LGTM! 인증 체크 시 리다이렉트 방지
getBoardShareForAuth를 사용하여 인증 상태 확인 중 실패 시에도 자동 리다이렉트가 발생하지 않도록 수정했습니다. 이는apiGetAuthCheck를 사용하는 새로운 함수로,skipAuthRedirect: "true"헤더를 포함하여 인증 체크 흐름에서 불필요한 리다이렉트를 방지합니다.Also applies to: 36-36
src/apis/board.ts (1)
36-40: LGTM! 인증 체크용 보드 공유 API 추가기존
getBoardShare함수와 병행하여 인증 체크용 함수를 추가했습니다.apiGetAuthCheck를 사용하여 인증 실패 시에도 자동 리다이렉트를 방지하면서 보드 공유 정보를 가져올 수 있습니다.두 함수의 역할 구분:
getBoardShare(line 32-34): 일반적인 인증된 요청getBoardShareForAuth(lines 36-40): 인증 상태 확인용, 실패 시 리다이렉트 없음
Summary
Tasks
Summary by CodeRabbit
릴리스 노트
새로운 기능
개선
✏️ Tip: You can customize this high-level summary in your review settings.