-
Notifications
You must be signed in to change notification settings - Fork 2
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
[#110] Feat: 로그아웃 기능 구현 #116
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/hooks/api/auth/useLogout.ts
Outdated
const navigate = useNavigate(); | ||
|
||
const { mutate, ...rest } = useMutation({ | ||
mutationFn: () => patchLogOut(), |
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.
토큰이라 로그가웃 요청이 따로 필요하지 않을 거 같은데 api가 있는 이유가 있을까요? 한 번 발행한 토큰은 서버에서 만료시켜줄 수 없어서 서버에서 어떤 처리를 하는 지 궁금하네요
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.
안그래도 해당 부분 궁금해서 수진님께 여쭤봤었는데, 서버에서는 db에 저장되어 있는 리프레시토큰을 삭제합니다. 그리고 accessToken은 db에 blackout로 처리해 저장해서 로그아웃한 accessToken으로 접근이 불가능하도록 막았습니다
라고 하셨습니다!
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.
알겠습니다! 감사합니다 : )
src/hooks/api/auth/useLogout.ts
Outdated
navigate({ to: "/" }); | ||
}, | ||
onError: (error) => { | ||
console.log(error); |
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.
에러 로깅할때는 error trace 가능한 console.error 사용해주시면 좋을 것 같습니당
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.
넵 알겠습니다~!
src/hooks/api/auth/useLogout.ts
Outdated
const navigate = useNavigate(); | ||
|
||
const { mutate, ...rest } = useMutation({ | ||
mutationFn: () => patchLogOut(), |
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.
넘겨줄 파라미터 없어서 화살표 함수는 제거하고 patchLogout()
만 작성해도 될 것 같네요?
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.
LGTM 🦕
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.
LGTMLGTMLGTM
📝 작업 내용
테스트 해보시려면 core.ts의 요청을 가로채는 부분에서 상수로 등록한
�ACCESS_TOKEN
을getLocalStorage
에 넣어주시고, #85 의 로그인 모달에 수정된 부분을 현재 PR의 로그인 모달에 넣어주시면 됩니다!📷 스크린샷 (선택)
💬 리뷰 요구사항(선택)
📍 기타 (선택)
close #110