소셜로그인 next-auth -> cookie 변경#117
Merged
leetaewon123 merged 6 commits intodevfrom Sep 11, 2025
Merged
Conversation
added 6 commits
September 11, 2025 16:42
|
Caution Review failedThe pull request is closed. Walkthrough여러 인증 흐름을 정비했습니다. 디버그 로그를 제거하고, 로그아웃 시 사용자 스토어를 초기화하도록 수정했으며, UserStore의 setUser가 null을 허용하도록 타입을 확장했습니다. 로그인/소셜로그인은 토큰 저장 후 유저 정보를 API로 조회해 스토어에 반영하고, 네비게이션 바는 사용자 존재 여부로 UI를 분기합니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant L as useLogin Hook
participant API as Auth API
participant S as User Store
participant NAV as Router
U->>L: submit(credentials)
L->>API: POST /login
API-->>L: status 200 + tokens / non-200
alt status 200
L->>L: save tokens (cookie/local)
L->>API: GET /user-info
API-->>L: 200 + IMyInfo / error
alt user-info 200
L->>S: setUser(user)
L->>NAV: redirect '/' or onLoginSuccess()
else user-info error
L->>U: alert(error message)
end
else non-200
L->>U: alert(server message or default)
end
sequenceDiagram
autonumber
participant U as User (Social)
participant SL as useSocialLogin Hook
participant CK as Cookies
participant API as User API
participant S as User Store
participant NAV as Router
U->>SL: arrive with accessToken, refreshToken
SL->>SL: guard missing tokens (exit)
SL->>CK: set cookies (accessToken, refreshToken)
SL->>API: GET /user-info
API-->>SL: 200 + IMyInfo / error
alt 200
SL->>S: setUser(user)
SL->>NAV: onLoginSuccess() or redirect '/'
else error
SL->>U: alert(fetch failed)
end
sequenceDiagram
autonumber
participant U as User
participant LG as logoutMutation
participant TOK as TokenStore
participant S as User Store
participant NAV as Router
participant QC as QueryCache
U->>LG: logout()
LG->>TOK: remove tokens
LG->>S: setUser(null)
LG->>QC: invalidate/clear caches
LG->>NAV: navigate to '/'
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (7)
✨ Finishing touches
🧪 Generate unit tests
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 was referenced Sep 12, 2025
Merged
Merged
Merged
Closed
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.
🔎 작업 사항
➕ 관련 이슈
Summary by CodeRabbit
Bug Fixes
Refactor
Chores