-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feat/auth 로그인 페이지의 alert를 Mui Alert로 변경과 토큰 검증 및 갱신 자동화 #204
Conversation
// axios 인터셉터 설정 컴포넌트 | ||
const InterceptorSetup: React.FC<InterceptorSetupProps> = ({ children }) => { | ||
const store = useLoginStore(); | ||
const navigate = useNavigate(); | ||
React.useEffect(() => { | ||
interceptorSetup(store, navigate); | ||
}, [store, navigate]); | ||
|
||
return <>{children}</>; | ||
}; |
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.
저는 axios 인스턴스를 새로 만들어서 interceptor로 토큰 검증 로직짜고, 만든 인스턴스를 가져다 쓰는 쪽으로 사용했었는데,
여기다가 함수 호출해서 interceptor 설정하는 방법도 있는지 몰랐어요. 이런 방법도 있었군요 신기하네요
주석도 다 달아 놓으셔서 이해하기 편했습니다!
근데 안쓰는 console.log()가 메모리 누수나 성능에 안좋아서 필요 없는 부분+ 테스트 끝난 부분 있으시면 지우는게 좋대요
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.
console.log()의 경우 로그인 관련 기능개발이 완전히 다 끝나면 지우도록 하겠습니다 :) 조언 감사합니다!
📝작업 내용
로그인 성공시
검증 성공시
검증 실패시
스크린샷 (선택)
💬리뷰 요구사항(선택)