[FIX] 온보딩 미완료 사용자의 홈(main 라우트) 접근 제한#273
Conversation
- 온보딩 미완료 사용자를 /onboarding으로 리다이렉트하는 OnboardingRequiredGuardProvider를 추가했습니다 - (main) 레이아웃에 해당 가드를 적용해 /home 등 메인 라우트 접근을 막았습니다
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 33 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: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
Timo Performance ReportBundle Size — timo-web
Lighthouse — timo-web
Image Optimization — timo-web
측정 커밋: |
ISSUE 🔗
close #272
What is this PR? 🔍
온보딩을 완료하지 않은 사용자가
/home을 포함한(main)라우트에 접근할 수 있던 버그를 수정했습니다.배경
(main)레이아웃은AuthGuardProvider로만 보호되어 있었고,AuthGuardProvider는accessToken존재 여부만 검사했습니다. 온보딩 완료 여부(onboardingCompleted)를 검사하는 가드는OnboardingCompletedGuardProvider하나뿐이었는데, 이는/onboarding페이지에서 이미 온보딩을 완료한 사용자를/home으로 내보내는 반대 방향 가드였습니다./home등(main)라우트로 직접 접근하면, 온보딩을 건너뛴 채 홈 화면에 그대로 진입할 수 있었습니다.onboardingCompleted가false인 사용자를/onboarding으로 리다이렉트하는 반대 방향 가드를 새로 만들고,(main)레이아웃에 적용했습니다.온보딩 접근 가드
OnboardingRequiredGuardProvider를 신설하고(main)/layout.tsx에서AuthGuardProvider하위에 적용했습니다.accessToken)와 온보딩 완료 여부(onboardingCompleted)는 서로 다른 조건이라 하나의 가드가 두 책임을 모두 지지 않도록 분리했습니다.AuthGuardProvider는/onboarding페이지에서도 그대로 재사용되고 있어, 만약AuthGuardProvider자체에 온보딩 완료 검사를 추가하면 온보딩 미완료 사용자가 온보딩 페이지 자체에 진입하지 못하는 리다이렉트 루프가 생기기 때문에 별도 컴포넌트로 분리했습니다.OnboardingCompletedGuardProvider와 동일한 패턴으로,useAuthStore에서onboardingCompleted,isInitialized를 구독해isInitialized && !onboardingCompleted일 때router.replace(ROUTES.ONBOARDING)을 호출합니다.isInitialized가 끝나기 전이나 온보딩이 미완료 상태면children을 렌더링하지 않고null을 반환해 리다이렉트 전 깜빡임을 막습니다./onboarding페이지 자체는 이번 가드의 적용 대상이 아닙니다 (AuthGuardProvider만 적용되어 있고,OnboardingRequiredGuardProvider는(main)레이아웃에만 적용됩니다).To Reviewers
AuthGuardProvider가/onboarding페이지와(main)레이아웃 양쪽에서 공유되고 있어,AuthGuardProvider자체를 수정하는 대신 온보딩 완료 검사를 별도OnboardingRequiredGuardProvider로 분리해(main)레이아웃에만 적용했습니다. 이 분리가 적절한지 확인 부탁드립니다.Screenshot 📷
Test Checklist ✔
pnpm check-types통과pnpm lint통과pnpm build통과/home직접 접근 시/onboarding리다이렉트 확인 — 미실행: 로컬 인증 계정 없어 재현 불가