Skip to content

develp branch 작업내용 머지 : develop -> main#140

Merged
heeeeyong merged 3 commits into
mainfrom
develop
Aug 17, 2025
Merged

develp branch 작업내용 머지 : develop -> main#140
heeeeyong merged 3 commits into
mainfrom
develop

Conversation

@heeeeyong
Copy link
Copy Markdown
Collaborator

@heeeeyong heeeeyong commented Aug 17, 2025

이하동일

Summary by CodeRabbit

  • 새 기능

    • 소셜 로그인 완료 후 자동으로 토큰을 교환/저장하여 로그인 절차가 매끄럽게 진행됩니다.
    • 회원가입 페이지와 피드 페이지에서 로그인 토큰이 URL에 포함된 경우 자동 처리 및 URL 정리를 수행합니다.
  • 개선/리팩터

    • 기존 OAuth 토큰 처리 로직을 단순화하고 공통 훅으로 통합해 안정성과 일관성을 높였습니다.
    • 인증 관련 API 연동을 분리하여 유지보수성을 향상했습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

소셜 로그인 토큰 처리 흐름을 대체/확장했습니다. OAuth 훅(useOAuthToken)을 제거하고, 경로에 따라 쿠키 설정 또는 임시 토큰 교환을 수행하는 useSocialLoginToken 훅을 추가했습니다. 이에 맞춰 Feed/Signup 페이지를 갱신했으며, /auth/set-cookie 및 /auth/exchange-temp-token API 클라이언트 래퍼와 인덱스 재노출을 추가했습니다.

Changes

Cohort / File(s) Summary
Auth API 래퍼 추가/노출
src/api/auth/exchangeTempToken.ts, src/api/auth/setCookie.ts, src/api/auth/index.ts
새로운 POST API 래퍼 두 개 추가: /auth/exchange-temp-token, /auth/set-cookie. 요청/응답 타입 정의. index에서 setCookie, exchangeTempToken 재노출.
훅 리팩터링
src/hooks/useOAuthToken.ts, src/hooks/useSocialLoginToken.ts
구 훅 useOAuthToken 삭제. 신규 훅 useSocialLoginToken 추가: URL의 loginTokenKey를 검사하고, 경로가 /signup이면 set-cookie, 그 외 경로면 exchange-temp-token 호출 후 쿼리 제거.
페이지 통합
src/pages/feed/Feed.tsx, src/pages/signup/SignupGenre.tsx, src/pages/signup/SignupNickname.tsx
토큰 훅 사용처를 useSocialLoginToken으로 변경/추가. 기존 로직 변화 없음.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User/Browser
  participant P as Page (Feed/Signup)
  participant H as useSocialLoginToken
  participant C as apiClient
  participant S as Auth Service

  U->>P: 페이지 로드
  P->>H: 훅 초기화
  H->>H: URL에서 loginTokenKey 추출
  alt 경로 = /signup
    H->>C: POST /auth/set-cookie (withCredentials)
  else 기타 경로
    H->>C: POST /auth/exchange-temp-token (withCredentials)
  end
  C->>S: 요청 전달
  S-->>C: 응답(성공/실패)
  C-->>H: 응답 반환
  alt 성공
    H->>U: URL의 loginTokenKey 파라미터 제거(replaceState)
  else 실패
    H->>P: 로그/필요시 navigate('/')
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

✨ Feature

Suggested reviewers

  • ho0010

Poem

(\/)
( •
•) 토큰 톡톡, 쿠키 콩콩—
/︶︶\ 로그인 열쇠는 URL 속에 숨었네.
홱—경로 살펴 한 번에 교환!
사라진 쿼리, 말끔한 화면.
깡충깡충, 새 훅 타고 로그인 완성! 🥕


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2049b2d and 7509bb7.

📒 Files selected for processing (8)
  • src/api/auth/exchangeTempToken.ts (1 hunks)
  • src/api/auth/index.ts (1 hunks)
  • src/api/auth/setCookie.ts (1 hunks)
  • src/hooks/useOAuthToken.ts (0 hunks)
  • src/hooks/useSocialLoginToken.ts (1 hunks)
  • src/pages/feed/Feed.tsx (2 hunks)
  • src/pages/signup/SignupGenre.tsx (2 hunks)
  • src/pages/signup/SignupNickname.tsx (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 17, 2025

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

Project Deployment Preview Comments Updated (UTC)
thip Ready Ready Preview Comment Aug 17, 2025 6:52am

@heeeeyong heeeeyong merged commit b21167d into main Aug 17, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant