fix(auth): 로그인 상태에서 /login·/signup 접근 시 대시보드로 (GuestGuard) - #42
Merged
Conversation
- 랜딩 "호스트로 시작"=/login 인데 인증 가드가 없어, 이미 로그인한 사용자에게도 로그인 폼이 다시 표시되던 문제 - GuestGuard 추가: GET /auth/me 로 세션 복원 후 이미 인증 상태면 /dashboard/quizzes 로 router.replace - app/login/page, app/signup/page 에 적용 (AuthGuard 의 반대 역할)
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.
증상
랜딩 "호스트로 시작"을 누르면 무조건 로그인 화면이 뜨고, 방금 로그인해도 반복됨.
원인
"호스트로 시작"은
/login링크인데,/login·/signup에 이미 로그인했으면 대시보드로 보내는 가드가 없음 → 로그인 상태에서도 로그인 폼이 다시 표시됨.수정
GuestGuard추가(AuthGuard의 반대):GET /auth/me로 세션 복원 검증 → 이미 인증 상태면/dashboard/quizzes로router.replaceapp/login/page·app/signup/page에 적용검증
pnpm tsc --noEmit✅ ·pnpm build✅