fix: 소셜 로그인 OAuth URL 실패 에러 처리 및 중복 클릭 방지 - #324
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughLoginButtons 컴포넌트가 웹 소셜 로그인 pending 상태를 추가하고, 네이티브와 웹 경로를 공용 처리로 통합했습니다. 버튼 상태는 네이티브와 웹 pending 모두를 반영하도록 변경됐고, 웹 경로는 OAuth URL 요청 실패 시 토스트를 표시합니다. Changes소셜 로그인 pending 상태 통합
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant LoginButtons
participant postNativeMessage
participant getAuthUrl
User->>LoginButtons: 소셜 로그인 클릭
LoginButtons->>postNativeMessage: 네이티브 브릿지 요청
alt 웹 경로
LoginButtons->>LoginButtons: webPendingProvider 설정
LoginButtons->>getAuthUrl: OAuth URL 요청
getAuthUrl-->>LoginButtons: URL 또는 에러
LoginButtons->>LoginButtons: window.location.href 이동 또는 토스트 표시
else 네이티브 경로
postNativeMessage-->>LoginButtons: 네이티브 로그인 처리
end
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/app/login/_components/LoginButtons.tsx`:
- Around line 84-97: `handleSocialLogin` in `LoginButtons` clears
`webPendingProvider` in `finally`, which re-enables the button even after a
successful social login redirect. Move the pending reset so it runs only in the
failure path inside the `catch` block, and keep the success path
(`window.location.href = url`) from resetting state since navigation will take
over. Preserve the existing `postNativeMessage`, `getAuthUrl`, and
`setWebPendingProvider` flow, but ensure the duplicate-click guard remains
active until the page actually leaves.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 23eb12ed-9c6b-42fe-9b59-fc9f54c61219
📒 Files selected for processing (1)
apps/web/src/app/login/_components/LoginButtons.tsx
* fix: 소셜 로그인 OAuth URL 실패 에러 처리 및 중복 클릭 방지 * fix: OAuth URL 성공 시 webPendingProvider 초기화 제거 --------- Co-authored-by: soyeong <mb535622@sookmyung.ac.kr>
작업 요약
작업 세부 내용
LoginButtons.tsx(GET /api/v1/auth/{provider}/url).then체인에.catch없음, appleawait에try/catch없음 → unhandled rejection 수정handleSocialLogin헬퍼로 통합,try/catch로 실패 토스트 처리webPendingProvider상태 추가 → API 요청 중 버튼 비활성화로 중복 클릭 방지nativePendingProvider와webPendingProvider를activePendingProvider로 통합해 버튼 로딩/disabled 처리usePostGuestLogin.ts(POST /api/v1/auth/guest)onError없음 → 전역 에러 net이 generic 토스트로 자동 커버됨을 확인연관 이슈
closes #303
Summary by CodeRabbit