Skip to content

fix: 소셜 로그인 OAuth URL 실패 에러 처리 및 중복 클릭 방지 - #324

Merged
iOdiO89 merged 3 commits into
devfrom
fix/303-auth-error-handling
Jul 13, 2026
Merged

fix: 소셜 로그인 OAuth URL 실패 에러 처리 및 중복 클릭 방지#324
iOdiO89 merged 3 commits into
devfrom
fix/303-auth-error-handling

Conversation

@soyeong0115

@soyeong0115 soyeong0115 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

작업 요약

  • 소셜 로그인 OAuth URL 요청 실패 에러 처리 및 중복 클릭 방지

작업 세부 내용

LoginButtons.tsx (GET /api/v1/auth/{provider}/url)

  • kakao/google .then 체인에 .catch 없음, apple awaittry/catch 없음 → unhandled rejection 수정
  • 3개 provider 핸들러를 handleSocialLogin 헬퍼로 통합, try/catch로 실패 토스트 처리
  • webPendingProvider 상태 추가 → API 요청 중 버튼 비활성화로 중복 클릭 방지
  • nativePendingProviderwebPendingProvideractivePendingProvider로 통합해 버튼 로딩/disabled 처리

usePostGuestLogin.ts (POST /api/v1/auth/guest)

  • 코드 변경 없음
  • onError 없음 → 전역 에러 net이 generic 토스트로 자동 커버됨을 확인
  • 실패 시 재시도 유도 등 맞춤 UX는 전역 토스트로 충분하다고 판단 → 추가 대응 없이 close

연관 이슈

closes #303

Summary by CodeRabbit

  • Bug Fixes
    • 웹/네이티브 소셜 로그인의 대기 상태를 함께 반영해, 로그인 중 버튼 비활성화와 로딩 표시가 더 정확해졌습니다.
    • 소셜 로그인 처리 흐름이 개선되어 실패 시 안내가 표시되고, 웹의 진행 상태가 정상적으로 해제됩니다.
    • 카카오/구글/애플 소셜 로그인 흐름이 공통 처리 방식으로 통합되어 동작이 더 일관되게 개선되었습니다.

@soyeong0115 soyeong0115 self-assigned this Jul 9, 2026
@soyeong0115 soyeong0115 added the fix Something isn't working label Jul 9, 2026
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
depromeet Ready Ready Preview, Comment Jul 12, 2026 11:59pm

@github-actions
github-actions Bot requested review from iOdiO89 and kanghaeun July 9, 2026 15:46
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c7a1882-de54-4fb0-a3e8-0e077bc1e29a

📥 Commits

Reviewing files that changed from the base of the PR and between 9981844 and c4903c0.

📒 Files selected for processing (1)
  • apps/web/src/app/login/_components/LoginButtons.tsx
💤 Files with no reviewable changes (1)
  • apps/web/src/app/login/_components/LoginButtons.tsx

📝 Walkthrough

Walkthrough

LoginButtons 컴포넌트가 웹 소셜 로그인 pending 상태를 추가하고, 네이티브와 웹 경로를 공용 처리로 통합했습니다. 버튼 상태는 네이티브와 웹 pending 모두를 반영하도록 변경됐고, 웹 경로는 OAuth URL 요청 실패 시 토스트를 표시합니다.

Changes

소셜 로그인 pending 상태 통합

Layer / File(s) Summary
pending 상태와 로그인 분기
apps/web/src/app/login/_components/LoginButtons.tsx
webPendingProvider와 activePendingProvider/isAnyPending 계산이 추가·변경되고, kakao/google/apple 로그인 처리가 공용 handleSocialLogin으로 통합됐다. 네이티브는 postNativeMessage로, 웹은 getAuthUrl과 window.location.href로 처리하며 실패 시 토스트와 webPendingProvider 초기화가 수행된다.
버튼 로딩과 비활성 상태
apps/web/src/app/login/_components/LoginButtons.tsx
SocialLoginButton의 isLoading과 disabled 조건이 activePendingProvider 기준으로 변경됐다.

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
Loading

Possibly related PRs

Suggested labels: WEB, refactor

Suggested reviewers: iOdiO89, ychany

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 소셜 로그인 OAuth URL 실패 처리와 중복 클릭 방지라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed OAuth URL 요청의 개별 실패 처리와 로딩/비활성화로 중복 클릭 방지 요구를 반영해 #303의 핵심 AC를 충족합니다.
Out of Scope Changes check ✅ Passed 요약된 변경은 LoginButtons.tsx의 소셜 로그인 흐름 개선에 국한되어 보이며, 명백한 범위 외 수정은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/303-auth-error-handling

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ef66bef and 9981844.

📒 Files selected for processing (1)
  • apps/web/src/app/login/_components/LoginButtons.tsx

Comment thread apps/web/src/app/login/_components/LoginButtons.tsx
@iOdiO89
iOdiO89 merged commit d60e67d into dev Jul 13, 2026
6 checks passed
@iOdiO89
iOdiO89 deleted the fix/303-auth-error-handling branch July 13, 2026 07:30
iOdiO89 pushed a commit that referenced this pull request Jul 19, 2026
* fix: 소셜 로그인 OAuth URL 실패 에러 처리 및 중복 클릭 방지

* fix: OAuth URL 성공 시 webPendingProvider 초기화 제거

---------

Co-authored-by: soyeong <mb535622@sookmyung.ac.kr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

게스트 로그인·OAuth URL 실패 대응

2 participants