-
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
Feat: 로그인 및 Account 페이지 API 연결, 토큰 관리 로직 구현 등 #216
Merged
Merged
Conversation
This file contains 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
CheeseB
approved these changes
Mar 28, 2024
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.
LGTM
designsoo
approved these changes
Mar 28, 2024
ccwnc
approved these changes
Mar 28, 2024
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.
관련 문서
유형
작업 내용
설명
📌 기능
🍪 토큰 관리
js-cookie
는 클라이언트 사이드에서만 접근이 가능하여 삭제하고,nookies
를 설치해 사용했습니다.utils/cookieUtils.ts
에서 구현했습니다.utils/checkAuth.ts
에서 구현했습니다.Auth.renewToken
메서드를CSR
과SSR
타입으로 구분했습니다.🔑 로그인 로직
useSignin
훅이 아니라, 훅의mutationFn
에서 직접 유저 입력값을 받도록 수정했습니다.useSignin
에서 반환하는error
객체의response status
를 활용해signinForm
에서 경고 모달을 띄우도록 했습니다.🧑🦱 account 로직
utils/checkAuth.ts
의requiresLogin
를 사용해 로그인하지 않은 유저는 롤 게시판으로 이동되도록 했습니다.refreshToken
만 있는 유저라면 토큰이 갱신되어 쿠키에 저장됩니다.SSR과 useQuery
app_.tsx
에HydrationBoundary
를 추가해, SSR에서 useQuery를 사용할 수 있게 설정하였습니다._app.tsx
📌 UI
error response status
에 따라 모달창이 뜹니다.📌 사용하기
💡requiresLogin, getAuthCookie, setAuthCookie
🎥 모션 영상
localhost_3000_signin.-.Chrome.2024-03-28.17-15-38.mp4
리뷰 요구사항