fix: 로그인 및 회원가입 뒤로가기 리디렉트 강화 등 오류 수정 - #76
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 53 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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)
📝 WalkthroughWalkthrough서버 쿠키의 역할 힌트와 인증 저장소 상태를 사용해 Changes인증 및 접근 경로
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant MoversLayout
participant BlockMoverFromMoversBrowse
participant AuthStore
participant Router
MoversLayout->>BlockMoverFromMoversBrowse: initialRole 전달
BlockMoverFromMoversBrowse->>AuthStore: 인증 상태와 역할 확인
BlockMoverFromMoversBrowse->>Router: 인증된 MOVER를 역할 홈으로 이동
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/auth/GuestOnly.tsx (1)
35-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win리디렉션 주석을 실제 동작과 일치시키세요.
예약 경로가 없을 때 이 코드는 즉시 역할 홈으로 이동하지 않습니다.
getPostAuthRedirectPath가 프로필 완료 상태를 조회하고, 미완료 사용자는 프로필 생성 경로로 이동합니다. 역할 홈은 조회 실패 시 fallback입니다.수정안
- // 예약된 경로가 없으면 역할 홈으로 이동 - // 예약된 경로가 있으면 예약된 경로로 이동 + // 예약된 경로가 있으면 해당 경로로 이동 + // 예약된 경로가 없으면 역할과 프로필 완료 상태로 목적지를 결정🤖 Prompt for 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. In `@src/components/auth/GuestOnly.tsx` around lines 35 - 48, Update the Korean comments above redirect so they accurately describe the actual behavior: a reserved path is used when available; otherwise getPostAuthRedirectPath checks profile completion, routes incomplete users to profile creation, and uses the role home only as the lookup-failure fallback. Do not change the redirect logic.
🤖 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.
Nitpick comments:
In `@src/components/auth/GuestOnly.tsx`:
- Around line 35-48: Update the Korean comments above redirect so they
accurately describe the actual behavior: a reserved path is used when available;
otherwise getPostAuthRedirectPath checks profile completion, routes incomplete
users to profile creation, and uses the role home only as the lookup-failure
fallback. Do not change the redirect logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a628a7a-095c-4886-967c-dfab37c45bf2
📒 Files selected for processing (5)
src/app/movers/layout.tsxsrc/components/auth/BlockMoverFromMoversBrowse.tsxsrc/components/auth/GuestOnly.tsxsrc/components/common/Input/PasswordInput.tsxsrc/lib/auth/redirect.ts
juengseulki
left a comment
There was a problem hiding this comment.
📋 PR 리뷰
👍 좋았던 점
- 로그인·회원가입 이후 뒤로가기로 인증 페이지에 재진입했을 때, 단순히 역할 홈으로 보내지 않고 프로필 완료 여부를 다시 확인하도록 보완했습니다.
- 보호 페이지에서 로그인으로 이동하며 저장한 예약 경로가 있으면 해당 경로를 우선 사용해 기존 사용자 의도를 유지했습니다.
- 예약 경로가 없는 경우에만
getPostAuthRedirectPath()를 호출해 불필요한 Profile Status 조회를 줄였습니다. - 회원가입 직후
/signup으로 뒤로가더라도 프로필 미완료 사용자는 프로필 생성 화면으로, 완료 사용자는 역할 홈으로 이동하도록 구성했습니다. - Profile Status 조회 실패 시 역할 홈으로 이동하는 기존 fallback 정책을 재사용했습니다.
- 비동기 Redirect 과정에 cleanup 상태를 두어 언마운트 이후 Redirect가 실행되는 상황을 방어했습니다.
- 기사 계정의
/movers접근 제한을 별도 Guard 컴포넌트로 분리해 Layout의 책임을 단순하게 유지했습니다. - 인증 Hydration과
checkAuth가 완료된 뒤에만 MOVER 여부를 판단해 초기 잘못된 Redirect를 방지했습니다. - Redirect 대상인 경우 children을 렌더링하지 않아 제한된 페이지의 순간 노출과 불필요한 하위 동작을 줄였습니다.
- 기존
LoginRequiredModalProvider구조를 유지해 비로그인·Customer의 기사 찾기 흐름에 미치는 영향을 최소화했습니다. - 현재 PR은 열려 있고 병합 가능한 상태이며, 변경 파일 5개로 수정 범위가 명확합니다.
🔍 확인 및 제안
필수 수정사항은 보이지 않았습니다.
가장 중요한 확인 사항은 MOVER 계정의 /movers 접근 제한 범위입니다.
현재 Guard가 /movers Layout에 적용되어 있기 때문에 다음 경로가 모두 차단됩니다.
- 기사님 찾기 목록
- 기사님 상세
- 기사 추천 또는 지도 화면
- 앞으로 추가되는
/movers하위 공개 페이지
서비스 정책이 “기사 찾기 도메인은 Customer와 비로그인 사용자 전용”이라면 현재 구조가 가장 일관적입니다.
반대로 기사님도 다른 기사님의 공개 프로필이나 공유받은 상세 페이지를 볼 수 있어야 한다면,
Layout 전체를 막기보다는 목록·추천 화면에만 Guard를 적용하고 상세 페이지는 허용하는 편이 적절합니다.
전체적으로 로그인·회원가입 직후 History 이동에서 발생하던 인증 페이지 재노출 문제를
기존 Redirect 정책을 재사용해 깔끔하게 보완한 것으로 보입니다.
수고하셨습니다! 😊
To Reviewer 내용 기준으로 기사 계정의 /movers 접근 제한 범위와
인증 페이지 뒤로가기 흐름을 중점적으로 확인했습니다!
로그인·회원가입 이후 뒤로가기로 인증 페이지에 다시 접근했을 때의 흐름은 적절해 보입니다.
예약된 이동 경로가 있으면 해당 경로를 우선 사용하고,
예약 경로가 없는 경우에만 역할과 프로필 완료 여부를 확인해 이동합니다.
따라서 다음과 같이 동작합니다.
- 보호 기능에서 로그인 후 인증 페이지 재진입
→ 기존에 예약한 목적지로 이동 - 회원가입 직후
/signup으로 뒤로가기
→ 프로필 미완료면 프로필 생성 화면 - 프로필 완료 사용자
→ 역할 홈 - 프로필 Status 조회 실패
→ 역할 홈
가입 직후 뒤로가기로 가입 폼에 다시 머무는 문제와,
프로필 미완료 사용자가 역할 홈으로 먼저 이동하는 문제를 함께 보완한 것으로 확인했습니다.
기사 계정의 /movers 접근을 모두 막는 것이 맞는지는 서비스 정책에 따라 결정하는 것이 좋습니다.
현재 구현은 /movers Layout에 Guard가 있으므로
기사 목록뿐 아니라 상세와 추천 등 모든 하위 페이지를 차단합니다.
아래 정책이라면 현재 구조가 적절합니다.
- 기사 찾기 기능은 Customer 전용
- 기사 계정은 다른 기사를 탐색할 필요가 없음
- 기사 상세 공유 링크도 기사 계정에서는 역할 홈으로 이동
반대로 아래 요구가 있다면 범위를 좁히는 편이 좋습니다.
- 기사도 다른 기사님의 공개 프로필을 볼 수 있음
- 외부에서 공유받은 기사 상세 링크는 로그인 역할과 관계없이 열 수 있음
- 목록과 추천만 Customer 전용이고 상세는 공개 페이지로 유지
이 경우에는 /movers 전체 Layout이 아니라
기사 목록·추천 화면에만 BlockMoverFromMoversBrowse를 적용하는 방식이 더 적절합니다.
현재 서비스에서 기사 찾기가 고객의 기사 선택 기능으로 정의되어 있다면
목록과 추천을 막는 것은 맞고,
상세까지 막을지는 공개 프로필 정책을 한 번 확인하면 좋겠습니다.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/auth/GuestOnly.tsx (1)
40-54: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win예약 경로 처리 뒤
redirect를 종료하세요.Line 43에서
reservedPath로 이동한 뒤에도 함수가 계속 실행됩니다. 이후getPostAuthRedirectPath가 완료되면 Line 54가 다시router.replace(intentPath)를 호출합니다. 이 호출이 예약 경로 이동을 역할 홈 또는 프로필 생성 경로로 덮어쓸 수 있습니다.
consumePostAuthRedirectPath()뒤에return을 추가하세요.수정 예시
if (reservedPath) { if (cancelled) return; router.replace(reservedPath); useAuthStore.getState().consumePostAuthRedirectPath(); + return; }🤖 Prompt for 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. In `@src/components/auth/GuestOnly.tsx` around lines 40 - 54, Update the reservedPath branch in GuestOnly so it returns immediately after router.replace(reservedPath) and consumePostAuthRedirectPath(), preventing the later getPostAuthRedirectPath flow from replacing the reserved redirect.
🤖 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.
Outside diff comments:
In `@src/components/auth/GuestOnly.tsx`:
- Around line 40-54: Update the reservedPath branch in GuestOnly so it returns
immediately after router.replace(reservedPath) and
consumePostAuthRedirectPath(), preventing the later getPostAuthRedirectPath flow
from replacing the reserved redirect.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c3f53981-999b-421d-a5aa-88b14e96e833
📒 Files selected for processing (1)
src/components/auth/GuestOnly.tsx
…into fix/auth-login-fix
📋 작업 내용
/movers에 접근하면 기사님 홈으로 리디렉트 하도록 수정하였습니다.tab-index={-1}을 추가하였습니다.🔥 변경 사항
GuestOnly
postAuthRedirectPath)가 없을 때getPostAuthRedirectPath로 status 조회를 합니다./signup에 다시 들어와도 가입 폼에 머물지 않고 프로필/홈으로 리디렉트 합니다.기사님 찾기 접근 제한
BlockMoverFromMoversBrowse추가 후app/movers/layout에 적용하였습니다.✅ 체크리스트
💬 To Reviewer
Summary by CodeRabbit