-
Notifications
You must be signed in to change notification settings - Fork 5
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
[FE] issue81: 로그인, 로그아웃 구현 #93
Conversation
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.
코드 잘 봤습니다. 수고했스요~ 머지 할께요!
setIsLoggedIn: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
const hasAccessToken = !!window.localStorage.getItem('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.
accessToken 상수로 빼주세용
}); | ||
|
||
export const LoginProvider = ({ children }: LoginProviderProps) => { | ||
const [isLoggedIn, setIsLoggedIn] = useState(hasAccessToken); |
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.
const [isLoggedIn, setIsLoggedIn] = useState(hasAccessToken); | |
const [isLoggedIn, setIsLoggedIn] = useState(() => !!window.localStorage.getItem('accessToken')); |
이런건 어떨까요? 보기가 좋아서요 ~
요약
헤더에 로그인 및 로그아웃 버튼 구현
세부사항
추후 변경 가능 사항
나중에 MyPage 구현시 로그아웃 버튼을 페이지 내부로 옮길 예정
Avatar 정보를 서버에서 가져와야 함
주의사항: 추후 배포할 때 깃헙 OAuth에 등록한 콜백 URL이 바뀔 수 있음
close #81