-
Notifications
You must be signed in to change notification settings - Fork 8
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] 로그인하지 않은 상태에서 페이지에 접근할 때 처리(#551) #552
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.
로그아웃 상태로 로그인 권한이 필요한 페이지에 접근했을 때 캐릭터 보여주는거 귀엽네요 ㅎㅎ
해당 페이지에 뒤로가기나 홈으로 가기 버튼을 만들어주는건 어떤가요?
그 외에 추가적으로 유저가 존재하지 않는 페이지에 접근했을 때 페이지 처리도 같이 하는건 어떨까요??
{ | ||
path: `profile/:username`, | ||
element: <UserProfile />, | ||
element: <PrivateRoute />, |
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.
로그인 상태에 따라 보여주는 거 좋은 것 같네용
다르 의견처럼 존재하지 않는 페이지 접근도 다른 이슈에서 처리해주면 좋을 것 같아요~~
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.
유저가 존재하지 않는 페이지에 접근했을 때 페이지 처리도 같이 하는건 어떨까요??
요거는 제가 처리했네요 ㅎㅎ
📓 스토리북 링크
바로가기
📌 관련 이슈
✨ PR 세부 내용
private 라우터와 public 라우터를 나누어서 private 일 때는 다른 화면을 보여주게 하였습니다.
![image](https://private-user-images.githubusercontent.com/63334368/375469322-ca674bf0-d2bc-42ca-b35f-31ef2e7b8683.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjY2OTksIm5iZiI6MTczOTU2NjM5OSwicGF0aCI6Ii82MzMzNDM2OC8zNzU0NjkzMjItY2E2NzRiZjAtZDJiYy00MmNhLWIzNWYtMzFlZjJlN2I4NjgzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIwNTMxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4ZTM1MjVlZGY0YjU5NmM4MDA5YzcxNGQyYmQyZTUxMjI0MTY2MjQ0MTBkNTA4MzFhNmM0MTUyZmE3NjU5MWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Wh_NL_DBmFz-IPftsGKhxLW89xdFIqp2iqyWKOf9Myo)
로그인 글자 보이게 하였습니다. 문구가 바에 가려지는 게 아쉽다는 피드백이 있었습니다. 이 디자인 어떤가욤??
![image](https://private-user-images.githubusercontent.com/63334368/375468631-0338293d-f07d-4365-aa61-cc52853e6f21.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjY2OTksIm5iZiI6MTczOTU2NjM5OSwicGF0aCI6Ii82MzMzNDM2OC8zNzU0Njg2MzEtMDMzODI5M2QtZjA3ZC00MzY1LWFhNjEtY2M1Mjg1M2U2ZjIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIwNTMxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNjYWFmM2FlZWQwMDdkYmQ4N2M2Y2U5MGYwMWIyMTQ0MDRjMmIzY2M0YTk2NmQxZWEzMWFiNGVjZWM4NDI0YzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.glkLobBSZ9K2EUFHGkFLbkjt159TVM4EC5hV5UHAXZU)
이전으로 갔을 때 callback 페이지로 넘어가면 로그인을 다시 하게 되어 오류가 생겼었습니다. 아래 코드를 추가하여 브라우저의 history stack에서 현재 페이지를 덮어쓰고, 새로운 페이지로 이동한 후에 뒤로 가기를 눌렀을 때 현재 페이지로 돌아올 수 없도록 하였습니다.
CallbackPage.tsx