Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. Walkthrough인증 흐름을 쿠키 기반에서 localStorage 토큰 기반으로 전환. 교환/쿠키 설정 API 제거, 신규 getToken API 추가. apiClient 인터셉터가 localStorage의 authToken을 사용하고 401 시 루트로 리다이렉트. useSocialLoginToken 훅이 토큰 발급을 기다리도록 변경되어 Feed/Signup/Login 플로우를 동기화. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant useSocialLoginToken
participant AuthAPI as getToken API
participant apiClient
participant Server
participant LocalStorage
User->>Browser: 소셜 로그인 리다이렉트 (URL에 loginTokenKey)
Browser->>useSocialLoginToken: 훅 초기화
useSocialLoginToken->>AuthAPI: getToken({ loginTokenKey })
AuthAPI->>apiClient: POST /auth/token
apiClient->>Server: Authorization 없음(초기), withCredentials
Server-->>apiClient: { data: { token } }
apiClient-->>AuthAPI: 응답 전달
AuthAPI-->>useSocialLoginToken: token 반환
useSocialLoginToken->>LocalStorage: setItem('authToken', token)
useSocialLoginToken->>Browser: URL에서 loginTokenKey 제거
sequenceDiagram
participant Component as Feed/SignupNickname
participant useSocialLoginToken
participant LocalStorage
participant apiClient
participant Backend
Component->>useSocialLoginToken: waitForToken()
useSocialLoginToken-->>Component: Promise resolved
Component->>LocalStorage: getItem('authToken')
LocalStorage-->>Component: token
Component->>apiClient: API 요청 (Authorization: Bearer token)
apiClient->>Backend: 요청 전달
Backend-->>apiClient: 200 또는 401
alt 401 Unauthorized
apiClient->>Component: 에러
apiClient->>Browser: window.location.href = '/'
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (11)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
#️⃣연관된 이슈
#73 [API] auth API 연동
📝작업 내용
리다이렉트 : /signup -> 임시토큰을 발급받아서 사용 -> 회원가입 절차 진행 후 엑세스토큰을 받아서 교체후 사용
리다이렉트 : /feed -> 바로 토큰 사용
회원가입 성공시, localStorage의 토큰을 새로운 토큰으로 교체
이미 회원인 경우, 그냥 바로 토큰 사용 3. 토큰이 만료되지 않은 경우 로그인 페이지로 이동시, /feed로 리다이렉트 4. 토큰이 만료된 경우 로그인페이지로 리다이렉트
💬리뷰 요구사항
없음