feat: 데스크톱 앱 로그인 핸드오프 페이지 추가 (/auth/desktop)#385
Merged
Conversation
- /auth/desktop 진입 시 redirect_uri 화이트리스트 검증 (127.0.0.1:23338-23342) - 인증됨 → 즉시 콜백 URL로 토큰 리디렉트, 미인증 → GitHub OAuth 흐름 위임 - state 파라미터 에코, open redirect 방지 처리 포함 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough새로운 데스크톱 인증 플로우를 추가합니다. 서버 진입점에서 리디렉션 URI와 상태를 검증하고 세션을 확인하여 인증된 사용자를 데스크톱 앱으로 리디렉트하거나 클라이언트 인증 페이지로 안내합니다. 미들웨어에서 Changes
Sequence DiagramsequenceDiagram
actor User
participant Client as Desktop Client
participant Server as Server<br/>(noLocale)
participant Auth as Client Page<br/>[locale]
participant Session as Session
User->>Client: 인증 시작 (redirect_uri + state)
Client->>Server: /auth/desktop?redirect_uri=...&state=...
Server->>Server: redirect_uri & state 검증
alt 검증 실패
Server->>User: 오류 메시지 표시
else 검증 성공
Server->>Session: 세션 확인
alt 액세스 토큰 있음
Server->>Client: 데스크톱 콜백 URL로 리디렉트
Client->>Client: 인증 완료
else 액세스 토큰 없음
Server->>Auth: /[locale]/auth/desktop?redirect_uri=...&state=...로 리디렉트
Auth->>User: 로그인 프롬프트 표시
User->>Auth: 로그인 수행
Auth->>Session: 세션 생성
Auth->>Client: 데스크톱 콜백 URL로 리디렉트
Client->>Client: 인증 완료
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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.
Summary
/auth/desktop?redirect_uri=...&state=...진입점 추가 — 데스크톱 앱이 GitHub OAuth를 웹에 위임하고 토큰을 로컬 콜백 서버로 전달받는 흐름redirect_uri화이트리스트 검증 (127.0.0.1:23338-23342/auth/callback한정), 검증 실패 시 리디렉트 없이 에러 페이지 렌더 (open redirect 방지){redirect_uri}?token={accessToken}&state={state}리디렉트, 미인증 → 기존 GitHub OAuth 흐름 위임 후 복귀Changes
apps/web/src/constants/desktopAuth.ts— 화이트리스트 정규식 + 검증 함수 + 콜백 URL 빌더apps/web/src/app/(noLocale)/auth/desktop/page.tsx— 서버 컴포넌트 진입점 (검증, 세션 확인, 리디렉트 분기)apps/web/src/app/[locale]/auth/desktop/page.tsx— 클라이언트 컴포넌트 (미인증 시 login() 트리거)apps/web/src/middleware.ts—/auth/desktoppublicPages 추가Test plan
/auth/desktop?redirect_uri=http://127.0.0.1:23338/auth/callback&state=abc123접근 → OAuth → 콜백 URL에?token=...&state=abc123확인🤖 Generated with Claude Code
Summary by CodeRabbit
릴리스 노트