Skip to content

Conversation

@jjangminii
Copy link
Collaborator

@jjangminii jjangminii commented Jan 5, 2026

📌 Related Issues

관련된 Issue를 태그해주세요. (e.g. - close #25)

📄 Tasks

  • 디테일 수정
  • 구글 로그아웃시 이동뷰 제작
  • 로그인 로직 util로 분리

⭐ PR Point (To Reviewer)

현재 토큰이 없을 시 온보딩의 소셜로그인 스텝으로 이동 되고 있습니다.
이 pr에서 로그아웃시 이동 되는 로그인뷰가 추가되었는데 토큰 없을시 이동 되는 뷰를 온보딩에서 로그인 페이지로 변경하는건 어떤가요?

📷 Screenshot

image

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 로그인 페이지 추가 (구글 OAuth 인증 포함)
    • 약관 및 개인정보 처리방침 링크 추가
  • 개선사항

    • 로그인 및 온보딩 페이지에서 사이드바 숨김
    • 로그아웃 시 로그인 페이지로 이동하도록 변경
    • 로그인 페이지에서 자동 재시도 요청 방지

✏️ Tip: You can customize this high-level summary in your review settings.

@jjangminii jjangminii self-assigned this Jan 5, 2026
@jjangminii jjangminii linked an issue Jan 5, 2026 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Jan 5, 2026

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

Project Deployment Review Updated (UTC)
pinback-client-client Ready Ready Preview, Comment Jan 5, 2026 10:33am
pinback-client-landing Ready Ready Preview, Comment Jan 5, 2026 10:33am

@github-actions github-actions bot added the feat 기능 개발하라 개발 달려라 달려 label Jan 5, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

Walkthrough

구글 OAuth 인증을 기반으로 새로운 로그인 페이지를 추가하고, 레이아웃과 라우팅을 수정하여 로그인 경로에서 사이드바를 숨기며, 로그아웃 시 온보딩 대신 로그인 페이지로 이동하도록 변경했습니다.

Changes

Cohort / File(s) Summary
로그인 페이지 및 라우팅
apps/client/src/pages/login/Login.tsx, apps/client/src/routes/router.tsx, apps/client/src/routes/routesConfig.ts
새로운 로그인 페이지 컴포넌트 추가 및 /login 경로를 라우트 설정에 등록
Google OAuth 유틸리티
apps/client/src/shared/utils/handleGoogleLogin.ts
Google OAuth 인증 흐름을 처리하는 새로운 유틸리티 함수 생성 (환경 변수 기반 리다이렉트 URI 선택)
소셜 로그인 통합
apps/client/src/pages/onBoarding/components/funnel/step/SocialLoginStep.tsx
내부 Google 로그인 핸들러를 공유 handleGoogleLogin으로 대체, 개인정보 보호 정책 링크 추가
레이아웃 및 네비게이션
apps/client/src/layout/Layout.tsx, apps/client/src/shared/components/profilePopup/ProfilePopup.tsx
로그인 경로에서 사이드바 숨김, 로그아웃 시 온보딩에서 로그인 페이지로 이동 경로 변경
API 요청 처리
apps/client/src/shared/apis/setting/axiosInstance.ts
로그인 페이지에서 401/403 응답 재시도 방지하는 조건 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Client as Client<br/>(React App)
    participant GoogleOAuth as Google<br/>OAuth
    participant Server as Server<br/>(Backend)

    User->>Client: 로그인 페이지 방문 또는 소셜 로그인 버튼 클릭
    Client->>Client: handleGoogleLogin() 호출
    Note over Client: 환경 변수에서<br/>Client ID, Redirect URI 검증
    
    Client->>GoogleOAuth: Google OAuth 인증 URL로 리다이렉트<br/>(client_id, redirect_uri, scope)
    GoogleOAuth->>User: Google 로그인 프롬프트 표시
    User->>GoogleOAuth: Google 계정으로 인증
    GoogleOAuth->>Client: 인증 코드와 함께 redirect_uri로 리다이렉트
    
    Client->>Server: 인증 코드 전송 및 토큰 요청
    Server->>GoogleOAuth: 코드 검증 및 토큰 획득
    GoogleOAuth-->>Server: Access Token 반환
    Server-->>Client: 세션/토큰 설정
    
    Note over Client: axios 인터셉터:<br/>로그인 페이지에서는<br/>401/403 재시도 방지
    Client->>Client: 앱 진입 (사이드바 표시)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

feat

Suggested reviewers

  • jllee000

Poem

🐰 로그인의 숲 속으로 옹기종기
구글 요정을 손을 잡고 가네요
온보딩 길 헤매지 않도록
로그인 이정표를 세워주었어요
사이드바는 눈 감았다 뜨면
반갑게 인사할 준비가 됐답니다 ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR 변경사항이 #231 요구사항(로그아웃 시 이동되는 로그인뷰 추가)을 충족하지만, #25(Progress Bar)와는 무관합니다. #25는 이 PR과 무관한 다른 이슈입니다. 관련된 #231에 대한 코드 변경만 진행되었으므로, #25를 연결된 이슈에서 제거하거나 별도 PR로 분리하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경사항과 관련되어 있습니다. 로그아웃 시 Google 로그인 뷰 제작이라는 내용이 명확하게 전달됩니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 로그인 페이지 추가, 라우팅, 로그인 로직 분리, 로그아웃 네비게이션 변경 등 #231 요구사항과 관련되어 있습니다.
Description check ✅ Passed PR 설명이 템플릿의 모든 필수 섹션을 포함하고 있으며, 관련 이슈, 작업 내용, 리뷰어 요청사항, 스크린샷이 충분히 작성되어 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

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

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

✅ Storybook chromatic 배포 확인:
🐿️ storybook

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Fix all issues with AI Agents 🤖
In @apps/client/src/pages/onBoarding/components/funnel/step/SocialLoginStep.tsx:
- Around line 37-49: Update the two Link components in SocialLoginStep that
render "이용 약관" and "개인정보처리방침": change the first Link (the one wrapping the text
"이용 약관") so its to prop points to "/terms" instead of "/privacy", and keep the
second Link (the one wrapping "개인정보처리방침") pointing to "/privacy" so the routes
match Login.tsx.

In @apps/client/src/shared/utils/handleGoogleLogin.ts:
- Around line 12-19: The constructed googleAuthUrl in handleGoogleLogin uses raw
clientId and redirectUri which can break URLs; update the string building for
googleAuthUrl to encode clientId and redirectUri with encodeURIComponent (also
encode scope/other params if dynamic), e.g. replace direct ${clientId} and
${redirectUri} with encoded values, then assign window.location.href =
googleAuthUrl as before so the redirect URL is safe.
🧹 Nitpick comments (2)
apps/client/src/pages/login/Login.tsx (1)

10-71: 구현이 잘 되어 있습니다.

새로운 로그인 페이지가 공유 유틸리티를 올바르게 사용하고 있으며, 개인정보처리방침과 이용 약관 링크가 올바르게 분리되어 있습니다.

다만, 19번째 줄의 중앙 카드에 고정된 크기(h-[54.8rem] w-[63.2rem])가 적용되어 있습니다. 작은 화면에서는 레이아웃이 깨질 수 있으니, 필요시 반응형 스타일 적용을 고려해보세요.

apps/client/src/shared/utils/handleGoogleLogin.ts (1)

8-11: 사용자 경험 개선: alert() 대신 적절한 UI 피드백을 사용하세요.

환경 변수 누락 시 alert()를 사용하고 있습니다. 이는 사용자 경험 측면에서 좋지 않으며, 토스트 메시지나 에러 UI 컴포넌트를 사용하는 것이 더 적절합니다.

💡 개선 제안

프로젝트에서 사용 중인 토스트 알림이나 에러 모달 컴포넌트가 있다면, alert() 대신 해당 컴포넌트를 사용하는 것을 권장합니다. 예시:

if (!clientId || !redirectUri) {
  // 토스트 알림 사용 예시
  toast.error('Google OAuth 설정이 누락되었습니다.');
  return;
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24387fe and 4448cbc.

📒 Files selected for processing (8)
  • apps/client/src/layout/Layout.tsx
  • apps/client/src/pages/login/Login.tsx
  • apps/client/src/pages/onBoarding/components/funnel/step/SocialLoginStep.tsx
  • apps/client/src/routes/router.tsx
  • apps/client/src/routes/routesConfig.ts
  • apps/client/src/shared/apis/setting/axiosInstance.ts
  • apps/client/src/shared/components/profilePopup/ProfilePopup.tsx
  • apps/client/src/shared/utils/handleGoogleLogin.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-15T20:00:13.756Z
Learnt from: constantly-dev
Repo: Pinback-Team/pinback-client PR: 80
File: apps/client/src/shared/components/ui/modalPop/ModalPop.tsx:36-41
Timestamp: 2025-07-15T20:00:13.756Z
Learning: In apps/client/src/shared/components/ui/modalPop/ModalPop.tsx, the InfoBox component uses hardcoded values for title, location, and icon URL as temporary test data. These should be replaced with dynamic data from props when implementing actual functionality and should be marked with TODO comments for future changes.

Applied to files:

  • apps/client/src/shared/components/profilePopup/ProfilePopup.tsx
🧬 Code graph analysis (2)
apps/client/src/pages/login/Login.tsx (1)
apps/client/src/shared/utils/handleGoogleLogin.ts (1)
  • handleGoogleLogin (1-20)
apps/client/src/routes/router.tsx (1)
apps/client/src/routes/routesConfig.ts (1)
  • ROUTES_CONFIG (1-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: storybook
🔇 Additional comments (6)
apps/client/src/shared/components/profilePopup/ProfilePopup.tsx (1)

42-46: 로그아웃 네비게이션이 올바르게 구현되었습니다.

로그아웃 시 새로운 로그인 페이지로 이동하는 로직이 정확합니다. localStorage 정리도 적절히 수행되고 있습니다.

apps/client/src/routes/router.tsx (1)

3-3: 라우트 설정이 올바르게 추가되었습니다.

Login 컴포넌트 임포트와 라우트 엔트리가 기존 패턴을 따라 정확하게 구성되었습니다.

Also applies to: 41-44

apps/client/src/routes/routesConfig.ts (1)

26-29: 라우트 설정이 일관되게 추가되었습니다.

login 라우트 구성이 기존 패턴과 일치하며 올바르게 구현되었습니다.

apps/client/src/layout/Layout.tsx (1)

7-7: 사이드바 숨김 로직이 올바르게 확장되었습니다.

로그인 페이지에서 사이드바를 숨기는 로직이 온보딩과 일관되게 구현되었습니다.

Also applies to: 12-12

apps/client/src/shared/apis/setting/axiosInstance.ts (2)

38-45: 로그인 페이지 체크 로직이 올바르게 구현되었습니다.

로그인 페이지에서 자동 리다이렉트를 방지하는 로직이 정확하게 추가되었습니다.


38-52: 인증 오류 시 네비게이션 흐름을 확인해주세요.

현재 구현에서는 다음과 같은 흐름이 생성됩니다:

  • 수동 로그아웃 → /login으로 이동 (ProfilePopup.tsx)
  • 앱 사용 중 401/403 오류 → /onboarding?step=SOCIAL_LOGIN으로 이동 (line 50)
  • 로그인 페이지에서 401/403 오류 → 리다이렉트 없음 (현재 페이지 유지)

이러한 서로 다른 네비게이션 타겟이 의도된 UX 설계인지 확인이 필요합니다. 사용자 입장에서 수동 로그아웃과 세션 만료 시 서로 다른 페이지로 이동하는 것이 혼란을 줄 수 있습니다.

Comment on lines +37 to +49
<Link
to="/privacy"
className="underline underline-offset-2 hover:opacity-70"
>
이용 약관
</Link>{' '}
{' '}
<Link
to="/privacy"
className="underline underline-offset-2 hover:opacity-70"
>
개인정보처리방침
</Link>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

링크 경로 불일치를 수정하세요.

"이용 약관"과 "개인정보처리방침" 링크가 모두 /privacy를 가리키고 있습니다. Login.tsx (50-55번째 줄)에서는 "이용 약관"이 /terms로, "개인정보처리방침"이 /privacy로 올바르게 분리되어 있습니다. 일관성을 위해 여기서도 동일하게 수정해야 합니다.

🔎 제안하는 수정 사항
       <Link
-          to="/privacy"
+          to="/terms"
           className="underline underline-offset-2 hover:opacity-70"
       >
         이용 약관
       </Link>{' '}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link
to="/privacy"
className="underline underline-offset-2 hover:opacity-70"
>
이용 약관
</Link>{' '}
{' '}
<Link
to="/privacy"
className="underline underline-offset-2 hover:opacity-70"
>
개인정보처리방침
</Link>
<Link
to="/terms"
className="underline underline-offset-2 hover:opacity-70"
>
이용 약관
</Link>{' '}
{' '}
<Link
to="/privacy"
className="underline underline-offset-2 hover:opacity-70"
>
개인정보처리방침
</Link>
🤖 Prompt for AI Agents
In @apps/client/src/pages/onBoarding/components/funnel/step/SocialLoginStep.tsx
around lines 37-49, Update the two Link components in SocialLoginStep that
render "이용 약관" and "개인정보처리방침": change the first Link (the one wrapping the text
"이용 약관") so its to prop points to "/terms" instead of "/privacy", and keep the
second Link (the one wrapping "개인정보처리방침") pointing to "/privacy" so the routes
match Login.tsx.

Comment on lines +12 to +19
const googleAuthUrl =
`https://accounts.google.com/o/oauth2/v2/auth?` +
`client_id=${clientId}` +
`&redirect_uri=${redirectUri}` +
`&response_type=code` +
`&scope=email profile`;

window.location.href = googleAuthUrl;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

URL 파라미터를 인코딩해야 합니다.

clientIdredirectUri를 URL에 직접 삽입하고 있지만, 특수 문자가 포함된 경우 URL이 깨지거나 보안 문제가 발생할 수 있습니다. 모든 파라미터는 encodeURIComponent()로 인코딩되어야 합니다.

🔎 제안하는 수정 사항
   const googleAuthUrl =
     `https://accounts.google.com/o/oauth2/v2/auth?` +
-    `client_id=${clientId}` +
-    `&redirect_uri=${redirectUri}` +
+    `client_id=${encodeURIComponent(clientId)}` +
+    `&redirect_uri=${encodeURIComponent(redirectUri)}` +
     `&response_type=code` +
-    `&scope=email profile`;
+    `&scope=${encodeURIComponent('email profile')}`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const googleAuthUrl =
`https://accounts.google.com/o/oauth2/v2/auth?` +
`client_id=${clientId}` +
`&redirect_uri=${redirectUri}` +
`&response_type=code` +
`&scope=email profile`;
window.location.href = googleAuthUrl;
const googleAuthUrl =
`https://accounts.google.com/o/oauth2/v2/auth?` +
`client_id=${encodeURIComponent(clientId)}` +
`&redirect_uri=${encodeURIComponent(redirectUri)}` +
`&response_type=code` +
`&scope=${encodeURIComponent('email profile')}`;
window.location.href = googleAuthUrl;
🤖 Prompt for AI Agents
In @apps/client/src/shared/utils/handleGoogleLogin.ts around lines 12-19, The
constructed googleAuthUrl in handleGoogleLogin uses raw clientId and redirectUri
which can break URLs; update the string building for googleAuthUrl to encode
clientId and redirectUri with encodeURIComponent (also encode scope/other params
if dynamic), e.g. replace direct ${clientId} and ${redirectUri} with encoded
values, then assign window.location.href = googleAuthUrl as before so the
redirect URL is safe.

Copy link
Member

@constantly-dev constantly-dev left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

originalRequest.url?.includes(url)
);

const isLoginPage = window.location.pathname.startsWith('/login');
Copy link
Member

Choose a reason for hiding this comment

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

여기도 분리한 상수 써도 될 것 같아요!

@jjangminii jjangminii merged commit 2478303 into develop Jan 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 기능 개발하라 개발 달려라 달려

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 구글 로그아웃 뷰

3 participants