-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Auth 관련 훅 분리 및 userId 쿠키 저장 #164
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
Conversation
- 로그인, 로그아웃, 회원가입, 회원탈퇴
- promise 중복으로 코드 삭제
추후 삭제 예정
- login시 저장 -logout시 삭제 - type 수정
|
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 ✨ 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 |
🎭 Playwright Report✨ E2E Test가 성공적으로 완료되었습니다. Test 요약 내용을 확인해주세요.
📊 Test Summary
📜 Test Details✅ Passed Tests (3)
|
🎨 Storybook Report✅ 변경 사항이 없습니다 모든 Story가 이전 빌드와 동일합니다.
|
📊 Coverage Report
📉 #164을 main에 병합하면 coverage가 Coverage 요약@@ Coverage Diff @@
## main #164 +/- ##
===========================================
- Coverage 39.18% 38.32% -0.86%
===========================================
Files 131 136 +5
Lines 5280 5406 +126
Branches 220 225 +5
===========================================
+ Hits 2069 2072 +3
+ Misses 3211 3334 +123 영향받은 파일
|
🚀 PR Preview Report✨ Build가 성공적으로 완료되었습니다. Preview에서 변경사항을 확인하세요.
|
Chiman2937
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고 하셨습니다~
📝 변경 사항
💡package.json
js-cookie,@types/js-cookie의존성 추가userId를 쿠키로 관리하기 위한 라이브러리 추가💡src/hooks/use-auth/use-auth-login.*
API.authService.login을 호출하는useLogin훅 구현LoginRequest타입을 인자로 받아 로그인 API 호출userId등 로그인 결과를 반환받도록 타입 정의 수정js-cookie를 사용해userId를 브라우저 쿠키에 저장 (Cookies.set('userId', String(result.userId))형태)formApi.reset()호출로 입력값 초기화router.push('/')를 통해 홈으로 이동💡src/hooks/use-auth/use-auth-logout.*
API.authService.logout을 호출하는useLogout훅 구현js-cookie를 사용해 로그인 시 저장한userId쿠키 제거router.push('/')등)를 통해 초기 화면으로 이동할 수 있도록 구성💡src/hooks/use-auth/use-auth-signup.*
API.authService.signup을 호출하는useSignup훅 구현/login페이지로 이동하는 흐름을 제공노출할 수 있도록 설계💡src/hooks/use-auth/use-auth-withdraw.*
useWithdraw훅 구현API.usersService.deleteMe(또는 이에 상응하는 회원탈퇴 API) 호출userId쿠키 제거💡src/lib/schema/auth.ts
loginSchema,signupSchema등 auth 관련 스키마의 유효성 검사 조건 변경 및 추가💡src/components/pages/login/*
useLogin훅 사용으로 전환💡src/types/service/auth.ts
LoginResponse타입에userId필드를 추가/수정🔗 관련 이슈
Closes #122
🧪 테스트 방법
📸 스크린샷 (선택)
📋 체크리스트
💬 추가 코멘트
CodeRabbit Review는 자동으로 실행되지 않습니다.
Review를 실행하려면 comment에 아래와 같이 작성해주세요