Week5/nonshaman-m3#54
Open
nonshaman wants to merge 12 commits into
Open
Conversation
Feat: Week3/nonshaman m1
feat: 3주차 미션 2 진행 (fix)
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
yewon20804
reviewed
May 5, 2026
Collaborator
yewon20804
left a comment
There was a problem hiding this comment.
5주차 미션3도 수고하셨습니다 🎉 구글 소셜로그인을 진행하셨고, 코멘트 내용만 추가된다면 더 완성도 높은 코드가 될 것 같습니다 !
토큰이 없을 때 에러 처리
// 현재
if (accessToken) {
setAccessToken(accessToken);
setRefreshToken(refreshToken);
window.location.href = "/mypage";
}
현재 토큰이 없는 경우 아무런 동작을 하지 않아 구글 로그인 리다이렉트 화면에 머물게 되는데요 !
실패 시 로그인 페이지로 리다이렉트하는 처리를 추가하시는 걸 추천드립니다 👍
// 개선
if (accessToken) {
setAccessToken(accessToken);
setRefreshToken(refreshToken);
window.location.href = "/mypage";
} else {
window.location.href = "/login";
}
refreshToken이 null일 때도 저장 시도
setRefreshToken(refreshToken);
현재 조건으로 accessToken만 체크하고 refreshToken은 별도로 검증하지 않아서, URL에 refreshToken이 없는 경우 null 값이 localStorage에 저장될 수 있습니다 ! refreshToken도 null 여부를 확인한 후 저장하면 더 안전한 코드가 될 것 같습니다 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 주차 / 미션
📌 작업 내용
-social login google 구현하기
✨ 상세 작업 내용
✅ 체크리스트