Conversation
added 12 commits
February 16, 2026 23:20
… into feature/60-kakao-login
… into feature/60-kakao-login
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
📝 변경 사항
🎯 작업 유형
📄 상세 내용
📄 상세 내용
주요 구현 내용
1. 카카오 OAuth 2.0 로그인 플로우 구현
카카오 인증 시작 (
src/app/page.tsx)NEXT_PUBLIC_KAKAO_CLIENT_ID,NEXT_PUBLIC_KAKAO_REDIRECT_URI){origin}/auth/kakao/callback카카오 콜백 처리 (
src/app/(auth)/auth/kakao/callback/page.tsx)code) 추출/auth/kakao/loginAPI 호출/signup?kakaoId={kakaoId}로 리다이렉트/home으로 리다이렉트2. 토큰 관리 시스템 구축
AuthStore 생성 (
src/store/authStore.ts)localStorage에 직접 토큰 저장/조회setTokens,clearTokens,getAccessToken,getRefreshToken,isAuthenticated메서드 제공토큰 저장 로직 (
src/api/auth.ts)accessToken,refreshToken을localStorage에 저장AuthStore와localStorage동기화3. 자동 토큰 관리 및 재발급
src/api/client.ts)Authorization: Bearer {accessToken}헤더 자동 추가구조/컨벤션 관련 변경 사항
파일 구조
src/app/(auth)/auth/kakao/callback/page.tsx: 카카오 콜백 전용 페이지src/store/authStore.ts: 인증 상태 관리 전용 스토어API 구조
src/api/auth.ts:kakaoLogin,kakaoSignup함수 추가login,refreshAccessToken함수에 토큰 저장 로직 통합토큰 저장 방식
localStorage에 직접 저장 (accessToken,refreshToken키 사용)persist미들웨어 제거 (직접localStorage관리로 변경)리뷰어가 알아야 할 포인트
OAuth 2.0 Authorization Code Flow
/auth/kakao/callback)토큰 관리 전략
localStorage에 직접 저장하여 페이지 새로고침 후에도 유지AuthStore는localStorage의 래퍼 역할persist미들웨어 제거 이유: 초기화 시null값으로 덮어쓰는 문제 방지자동 토큰 재발급 로직
/auth/refresh호출apiClient대신 일반axios사용 (무한 루프 방지)_retry플래그로 중복 재시도 방지에러 처리
환경 변수
NEXT_PUBLIC_KAKAO_CLIENT_ID: 카카오 앱 클라이언트 IDNEXT_PUBLIC_KAKAO_REDIRECT_URI: 카카오 콜백 URL (선택, 기본값:{origin}/auth/kakao/callback)🔗 관련 이슈
Closes #61
✅ 체크리스트