-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Refactor/#402] 로컬 스토리지의 role 여부에 따라, 저장된 로그인 여부 clear 하도록 수정 #403
Conversation
PR 작성하느라 고생 많았어요!! 라벨 잘 지정되었는지 확인 한 번 해 주기 🫶 |
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
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 user = localStorage.getItem("user"); | ||
if (user) { | ||
if (!JSON.parse(user)?.role) { | ||
// 기존에 존재하던 유저 role 유무로 임시로 토큰 제거 후 리로드 | ||
localStorage.clear(); | ||
window.location.reload(); | ||
return; | ||
} |
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.
p5) 굿굿 깔끔하네요 ~~
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.
p5 ) 진심 최고.......
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.
서버 측에서 강제 ROLE 관련해서 전체 강제 재로그인을 요청했는데... 고민해봤을 때 어떻게 할지 막막했는데 너무너무 좋은 방법인 것 같아요! ROLE이 부여되지 않은 회원이 문제가 되는 것이니 ROLE이 없는 유저만 강제로 로컬스토리지를 지워버리는 방법 너무 좋습니다... 최고👀👍🏻
const user = localStorage.getItem("user"); | ||
if (user) { | ||
if (!JSON.parse(user)?.role) { | ||
// 기존에 존재하던 유저 role 유무로 임시로 토큰 제거 후 리로드 | ||
localStorage.clear(); | ||
window.location.reload(); | ||
return; | ||
} |
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.
p5 ) 진심 최고.......
📌 관련 이슈번호
🎟️ PR 유형
어떤 변경 사항이 있나요?
✅ Key Changes
role 유무에 따라 로그아웃 처리하도록 변경합니다.
📢 To Reviewers
📸 스크린샷
🔗 참고 자료