Skip to content

feat(fe): impl kakao login#3628

Open
dayeoni wants to merge 22 commits into
feat/remove-whitelistfrom
t2754-impl-kakao-login-v2
Open

feat(fe): impl kakao login#3628
dayeoni wants to merge 22 commits into
feat/remove-whitelistfrom
t2754-impl-kakao-login-v2

Conversation

@dayeoni

@dayeoni dayeoni commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Description

카카오 로그인 연동

case 별 상이한 모달이 뜹니다.
최초 가입자 / 기존 가입자 별 소셜 로그인을 먼저 했을 때, 소셜 로그인이 아직 연동되지 않았을 때
분기를 나누어 이동할 수 있도록 작업합니다.

Additional context

개요

카카오 소셜 로그인 도입에 따른 프론트엔드 작업입니다. 백엔드 PR(#3627, t2752-redirect-to-frontend-after-kakao-oauth)의 redirect 변경에 맞춰, 로그인 시나리오를 4가지로 나눠 처리했습니다.

구현된 케이스

케이스 1 — 기존 가입자, 카카오로 로그인

  • 백엔드가 /로 redirect (쿼리 파라미터 없음)
  • 이 redirect 과정에서 accessToken(헤더)은 날아가고 refresh_token만 쿠키로 남기 때문에, SocialLoginHandler.tsx가 홈 진입 시 자동으로 GET /auth/reissueGET /user 호출해서 토큰/유저 정보를 받아오고, NextAuth social provider(authorizeSocial.ts, authOptions.ts)로 세션을 생성합니다.
  • 관련 파일: components/auth/SocialLoginHandler.tsx, libs/auth/authorizeSocial.ts, libs/auth/authOptions.ts, app/(client)/layout.tsx(마운트 지점)

케이스 2 — 미가입자, 카카오로 로그인 (신규가입 유도)

  • 백엔드가 /login?modal=social-unlinked&oauthToken=xxx로 redirect
  • LogInPage.tsxoauthToken을 쿼리에서 읽어 stores/socialAuth.ts(zustand)에 저장
  • "회원가입 이어서하기" 클릭 시 /signup으로 이동, store는 유지됨
최초 로그인- 소셜 로그인

케이스 3 — 카카오 로그인 시도했지만 기존 계정 존재 (모달에서 "로그인" 선택)

  • 케이스 2와 같은 모달에서 "로그인" 클릭 → /login으로 이동(oauthToken은 store에 유지)
  • 일반 로그인 성공 시, store에 oauthToken이 남아있으면 자동으로 POST auth/social-link를 호출해서 카카오 계정을 연동
  • 연동 실패해도 로그인 흐름은 막지 않음 (실패 시 콘솔 로그만)

케이스 4 — 일반 로그인 후 소셜 로그인 프로모션 모달

  • 일반(아이디/비밀번호) 로그인 성공 시, 방금 소셜 연동을 안 했다면 "소셜 로그인이 도입되었어요!" 모달 표시
  • "나중에 하기" → 홈 이동 / "로그인하러 가기" → /settings 이동
  • "오늘 하루 동안 안보기" 체크 시 localStorage 기반으로 당일 재노출 방지 (libs/auth/socialLoginPromoDismissal.ts)
  • 알려진 제약: 이미 카카오 연동이 된 사용자도 일반 로그인 시 이 모달을 보게 됩니다. GET /user가 연동 상태를 안 내려줘서 프론트에서 판단할 방법이 없기 때문입니다. Settings 페이지에서 소셜 연동 UI를 만들 때, 백엔드와 협의해서 GET /user 응답에 연동된 provider 목록을 추가하면 이 모달을 정확하게 스킵시킬 수 있습니다.
기존 로그인

추가

Figma에는 없지만, 깃허브+구글+네이버 로그인 시도 시 '준비 중인 기능입니다'를 띄워 작동하지 않도록 막았습니다.
준비중인 기능(깃헙, 네이버, 구글)


로컬 테스트 시 참고사항

  • 백엔드 PR #3627이 아직 main에 머지되지 않아서, 실제 카카오 redirect 흐름은 로컬에서 백엔드를 직접 띄워야 검증 가능합니다 (카카오 시크릿 필요).
  • 각 케이스는 프론트 로직만 독립적으로 검증 가능하도록 임시 코드로 우회 테스트했습니다\

Before submitting the PR, please make sure you do the following

closes TAS-2754

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces social login integration (primarily Kakao) and refactors the login and signup flows, including the addition of a SocialLoginHandler to manage NextAuth sessions, a new LogInLayout, and an InfoModal for unlinked social accounts. The code review feedback suggests several improvements: wrapping the login page in a <Suspense> boundary to prevent CSR de-optimization from useSearchParams(), removing unused commented-out code and an unused store selector, using the centralized baseUrl constant instead of raw environment variables, and properly handling unimplemented social login buttons to prevent user confusion.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread apps/frontend/app/(client)/login/page.tsx Outdated
Comment thread apps/frontend/app/(client)/login/page.tsx
Comment thread apps/frontend/components/auth/RecoverAccount/FindUserId.tsx Outdated
Comment thread apps/frontend/components/auth/RecoverAccount/RecoverAccount.tsx Outdated
Comment thread apps/frontend/components/auth/LogInPage/LogInPage.tsx
Comment thread apps/frontend/components/auth/LogInPage/LogInPage.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant