-
Notifications
You must be signed in to change notification settings - Fork 0
[FE-95]feat: protectedRoute 쿠키로 구현 #96
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
Conversation
-쿠키내에 SESSION Value가 없으면 로그인페이지로 리다이렉트
✅ Deploy Preview for record-it-dev ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Seongtaek-H
left a comment
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.
확인
sookyeonghwang
left a comment
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/routes/protectedRoute.tsx
Outdated
| const value = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)') | ||
| return value ? value[2] : null |
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.
이거 value가 무슨 뜻인가요?
그리고 value[2]도 어떤것을 뜻하는지 잘 모르겠습니당,,
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.
이부분 변수 바꾸고 value[2]는 상수화 해볼게요
src/routes/router.tsx
Outdated
| path: '/', | ||
| element: ( | ||
| <ProtectedRoute isPublic={true}> | ||
| <ProtectedRoute isPublic={false}> |
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.
이거는 제가 정책서 다시 보고올게요
-protectedRoute를 먹어야되는 컴포넌트 추가 -protectedRoute부분 변수명 알아보기 쉽도록 수정

작업 내용
-쿠키내에 SESSION Value가 없으면 로그인페이지로 리다이렉트
참고 이미지(선택)
어떤 점을 리뷰 받고 싶으신가요?
지금 저희 실제 배포환경처럼 isPublic을 false로 줬는데 SESSION을 꼭 쿠키에 넣어주시거나 개발환경에서 임시로 isPublic을 true로 둔뒤 작업하시고 그부분 커밋 안하셔도 좋을것같아용