Skip to content
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

Merged
merged 7 commits into from
Jul 2, 2024

Conversation

allone9425
Copy link
Contributor

  • PR을 정말 오랜만에 올립니다 :)...

📝작업 내용

  1. 로그인 페이지의 alert를 Mui Alert로 변경했습니다.
  2. axios 인터셉터로 토큰 검증 및 갱신 자동화를 했습니다.

로그인 성공시

image

검증 성공시

image

검증 실패시

image

스크린샷 (선택)

💬리뷰 요구사항(선택)

오류 잡는다고 정신없이 콘솔로그를 찍었더니 액세스 토큰인데 액세트토큰이라고 오류가 있네요 하핳... 다음 PR에 고치겠습니다.

@allone9425 allone9425 added the UI/UX front 기능 label Jun 28, 2024
@allone9425 allone9425 requested review from jihyun-j and yewon830 June 28, 2024 09:51
@allone9425 allone9425 self-assigned this Jun 28, 2024
Comment on lines +18 to +27
// axios 인터셉터 설정 컴포넌트
const InterceptorSetup: React.FC<InterceptorSetupProps> = ({ children }) => {
const store = useLoginStore();
const navigate = useNavigate();
React.useEffect(() => {
interceptorSetup(store, navigate);
}, [store, navigate]);

return <>{children}</>;
};
Copy link
Collaborator

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()가 메모리 누수나 성능에 안좋아서 필요 없는 부분+ 테스트 끝난 부분 있으시면 지우는게 좋대요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log()의 경우 로그인 관련 기능개발이 완전히 다 끝나면 지우도록 하겠습니다 :) 조언 감사합니다!

@jihyun-j jihyun-j merged commit cd7c120 into kSideProject:dev Jul 2, 2024
1 check passed
@allone9425 allone9425 deleted the feat/auth branch July 3, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI/UX front 기능
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants