-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] 인증 관련 로직 수정 #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Fix] 인증 관련 로직 수정 #307
Conversation
- proxy.ts: 인증 상태에서 /login, /signup 진입 시 /로 redirect하는 로직 추가 - useLogin의 router.replace를 window.location.replace로 수정
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 Report✅ 변경 사항이 없습니다 모든 Story가 이전 빌드와 동일합니다.
|
🎭 Playwright Report✨ E2E Test가 성공적으로 완료되었습니다. Test 요약 내용을 확인해주세요.
📊 Test Summary
📜 Test Details✅ Passed Tests (3)
|
📊 Coverage Report
📉 #307을 main에 병합하면 coverage가 Coverage 요약@@ Coverage Diff @@
## main #307 +/- ##
===========================================
- Coverage 40.32% 40.30% -0.02%
===========================================
Files 209 209 0
Lines 9384 9388 +4
Branches 406 406 0
===========================================
Hits 3784 3784 0
+ Misses 5600 5604 +4 영향받은 파일
|
🚀 PR Preview Report✨ Build가 성공적으로 완료되었습니다. Preview에서 변경사항을 확인하세요.
|
📝 변경 사항
❓ 문제
Production 환경에 접속 후 login 성공 시 / 혹은 원래 path로 redirect되지 않고 /login 페이지에 머무는 현상
🔍 현재 구조
useLogin훅에서 input 초기화, isAuthenticated를 true로 상태 변경,/또는 원래 path로 redirect하는 로직 포함proxy.ts에서 accessToken 혹은 refreshToken이 없을 경우/login으로 redirect(인증 필요한 페이지일 경우)💡 문제 원인에 대한 가설 정의 및 분석
router.replace와 상태변경에 의한 리렌더링(formApi.reset(),setIsAuthenticated)의 타이밍 이슈를 추측proxy.ts와 router.replace의 타이밍 충돌인 것으로 확인
🔍 관련 문서
아래 글에서 현재 문제 상황과 동일한 내용을 발견 후 추가 테스트 검증
vercel/next.js#51782
✔️ 결론
proxy.ts를 제거할 수 없으므로 useLogin에서 router.replace 대신 window.location.replace를 사용해야합니다.
🔗 관련 이슈
Closes #
🧪 테스트 방법
📸 스크린샷 (선택)
📋 체크리스트
💬 추가 코멘트
CodeRabbit Review는 자동으로 실행되지 않습니다.
Review를 실행하려면 comment에 아래와 같이 작성해주세요