-
Notifications
You must be signed in to change notification settings - Fork 1
서버와 클라이언트 인증 상태 일관성을 위한 프록시 라우트 구현 #145
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
Merged
Conversation
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
로그아웃 시 쿠키 삭제 안되는 문제 수정
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
taew0o
approved these changes
Dec 9, 2025
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.
#️⃣연관된 이슈
📝작업 내용
refresh route handler에서 갱신된 accessToken 값이 반환되지 않는 문제
cookies().set()->res.cookies.set()변경으로 응답에 쿠키 전달fetcher.server.ts에서는 요청 헤더에 쿠키를 직접 전달SSR 환경에서 401 발생했을 때, Next 서버가 갱신된 accessToken 값을 브라우저에게 전달할 수 없는 문제
fetcher.server.ts에서cookie로 브라우저에 전달해보려고 했으나, 서버 fetch 단계에서만 실행되므로 Response 객체(NextResponse)를 조작할 수 없어Set-Cookie헤더를 내려보낼 수 없음-> 브라우저가 갱신된 accessToken 값을 받기 위해서는 Next 서버가 실제 응답(Response)에
Set-Cookie를 포함해 내려줘야 함-> 이후 accessToken이 갱신되면 Route Handler에서
res.cookies.set()을 통해 새 토큰을 브라우저 쿠키로 전달할 수 있게 되어 SSR + CSR 환경 모두에서 토큰 재발급이 정상적으로 작동Next Route를 호출할 때 상대 경로(
/api/...)를 사용하면 서버 환경에서 잘못된 호스트로 요청이 보내지는 문제getBaseUrl()유틸을 추가하여 서버 환경에서 현재 요청의 절대 URL을 안전하게 생성하도록 보완마이페이지
cookie사용으로 인한 정적 렌더링 오류 발생force-dynamic옵션으로 설정하여 SSR 기반의 동적 렌더링을 강제스크린샷 (선택)
💬리뷰 요구사항(선택)