-
Notifications
You must be signed in to change notification settings - Fork 1
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
The head ref may contain hidden characters: "142-feat-\uC790\uB3D9-\uB85C\uADF8\uC778-\uC124\uC815"
Conversation
…nal-project/WEB1_1_Postman_FE into 142-feat-자동-로그인-설정
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/AuthProvider.tsx
Outdated
useEffect(() => { | ||
const initializeAuth = async () => { | ||
const accessToken = tokenStorage.getAccessToken(); | ||
if (accessToken) { | ||
const success = await handleGetUserInfo(); | ||
if (success) setIsLoading(false); | ||
} | ||
}; | ||
|
||
initializeAuth(); | ||
}, []); |
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.
중첩 if 문이 보이네요! 이렇게하면 중첩 If문을 제거할 수 있을 것 같아요!
useEffect(() => {
const initializeAuth = async () => {
const accessToken = tokenStorage.getAccessToken();
if (accessToken) {
return;
}
const success = await handleGetUserInfo();
if (success) {
setIsLoading(false);
}
};
initializeAuth();
}, []);
🚀요약
📸사진 (구현 캡처)
📝작업 내용
🔍백엔드 전달 사항
🎸기타 (연관 이슈)
close #142