[Feature/#367] 로그인/회원가입 returnUrl 복귀 처리 - #374
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanges인증 returnUrl 복귀 처리
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AuthGuard
participant Login
participant Signup
participant RedirectPage
participant sessionStorage
AuthGuard->>Login: 현재 경로를 returnUrl로 전달
Login->>Signup: returnUrl을 포함한 회원가입 경로로 이동
Signup->>Login: 회원가입 완료 후 returnUrl을 포함한 로그인 경로로 이동
Login->>sessionStorage: 소셜 로그인용 returnUrl 저장
sessionStorage->>RedirectPage: 인증 완료 후 returnUrl 제공
RedirectPage->>sessionStorage: returnUrl 삭제
RedirectPage-->>Login: 실패 시 returnUrl을 포함해 이동
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
📚 Storybook 배포 완료
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/utils/auth/returnUrl.ts`:
- Around line 12-18: Update getSafeReturnUrl validation after raw.trim() to
reject any C0 control characters and DEL (U+007F) before accepting the value,
while preserving the existing checks for leading slashes, protocol markers, and
backslashes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c48c2560-4d02-4f47-a0f7-e9304b65e8b5
📒 Files selected for processing (7)
src/components/auth/flows/signup/ProfileSetupStep.tsxsrc/hooks/auth/useSocialLogin.tssrc/pages/auth/Login.tsxsrc/pages/auth/RedirectPage.tsxsrc/pages/auth/Signup.tsxsrc/routes/Router.tsxsrc/utils/auth/returnUrl.ts
🚨 관련 이슈
Closed #367
✨ 변경사항
✏️ 작업 내용
로그인/회원가입/소셜 로그인/AuthGuard에서
returnUrl쿼리로 인증 후 복귀 경로를 제어합니다.getSafeReturnUrlbuildPathWithReturnUrl: path뒤에 안전한 returnUrl 쿼리를 붙임. 만약 없다면""빈문자열returnUrl이 있으면 해당 경로로 이동하고, 없으면/dashboard로 이동하도록 구현/login으로 보낼때retunUrl유지되도록 구현returnUrl유지/login?returnUrl=현재경로로 리다이렉트sessionStorage에 안전한returnUrl저장되도록 했습니다./oauth2/redirect에서 복원😅 미완성 작업
/invite:token초대 수락 페이지를 새로 UI 구현예정이고, 수락 API연동도 후속이슈에서 같이 진행할 예정📢 논의 사항 및 참고 사항
returnUrl은 token 자체가 아니라, 복귀 경로 입니다. ex)/invite/{token}//,://,\는 fallback처리합니다. (/dashboard로보냄)returnUrl을 넘기지 않고, 세션스토리지에서authReturnUrl을 유지합니다.Summary by CodeRabbit