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 : 자동 로그인 / 로그인 보호 설정 #277

Merged
merged 22 commits into from
Dec 6, 2024

Conversation

cmlim0070
Copy link
Collaborator

@cmlim0070 cmlim0070 commented Dec 6, 2024

🚀요약

📸사진 (구현 캡처)

📝작업 내용

  • AuthProvider 설정
  • useUserInfo 훅 분리
  • 자동 로그인 처리
  • 보호 라우트 처리

🔍백엔드 전달 사항

🎸기타 (연관 이슈)

close #142

@cmlim0070 cmlim0070 added ✨feature 기능 구현 좀 누가 해줭 ♻️ refactor 리펙토링 labels Dec 6, 2024
@cmlim0070 cmlim0070 added this to the 로그인&회원가입 milestone Dec 6, 2024
@cmlim0070 cmlim0070 self-assigned this Dec 6, 2024
Copy link
Collaborator

@saseungmin saseungmin left a comment

Choose a reason for hiding this comment

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

고생하셨씁니다~

Comment on lines 13 to 23
useEffect(() => {
const initializeAuth = async () => {
const accessToken = tokenStorage.getAccessToken();
if (accessToken) {
const success = await handleGetUserInfo();
if (success) setIsLoading(false);
}
};

initializeAuth();
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

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

중첩 if 문이 보이네요! 이렇게하면 중첩 If문을 제거할 수 있을 것 같아요!

useEffect(() => {
  const initializeAuth = async () => {
    const accessToken = tokenStorage.getAccessToken();

    if (accessToken) {
      return;
    }

    const success = await handleGetUserInfo();
    
    if (success) {
      setIsLoading(false);
    }
  };

  initializeAuth();
}, []);

Copy link

github-actions bot commented Dec 6, 2024

@cmlim0070 cmlim0070 merged commit 661f2b6 into develope Dec 6, 2024
1 check passed
@cmlim0070 cmlim0070 deleted the 142-feat-자동-로그인-설정 branch December 6, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨feature 기능 구현 좀 누가 해줭 ♻️ refactor 리펙토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat : 자동 로그인 설정
4 participants