refactor(login): 로그인 로직 수정(GET->POST)에 따른 수정 #107
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
app/auth/callback/route.ts — 백엔드 로그인 API 호출을 GET(쿼리 파라미터) → POST(JSON body)로 변경 app/auth/refresh/route.ts — reissue 응답에서 accessToken만 추출하도록 수정 (user 정보 제거) app/auth/refresh/route.test.ts — reissue 응답 스펙 변경에 맞춰 테스트 수정 src/shared/api/mock/mockUser.ts — mockReissueResponse에서 userDetails, userChannelDetails 제거 src/features/auth/mock/mockAuth.ts — mockReissueResponse 타입을 reissue 스펙에 맞게 변경 src/pages/channel/ui/ChannelPage.tsx — KpiSection import 경로 대소문자 수정
next.config.ts:4-13에 headers() 설정 추가 /auth/callback 라우트 응답에만 Cross-Origin-Opener-Policy: unsafe-none적용
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
juuhye
approved these changes
May 9, 2026
shunn2
reviewed
May 9, 2026
Comment on lines
113
to
123
| payload: Record<string, unknown> | ||
| ) { | ||
| const message = JSON.stringify({ type, ...payload }) | ||
| return `<!DOCTYPE html> | ||
| <html> | ||
| <body> | ||
| <script> | ||
| window.opener.postMessage(${message}, "${origin}"); | ||
| window.opener.postMessage(${message}, '*'); | ||
| window.close(); | ||
| </script> | ||
| </body> |
Collaborator
There was a problem hiding this comment.
- origin은 사용하면 안될 것 같아요.
window.opener null)는 next.config.ts의 헤더 설정으로 이미 해결된 것 같으니, targetOrigin은 다시 명시적으로 지정해 주세요.
const origin = process.env.NEXT_PUBLIC_APP_URL!
window.opener.postMessage(${message}, "${origin}");
로컬에서
NEXT_PUBLIC_APP_URL=http://localhost:3000
vercel에서
NEXT_PUBLIC_APP_URL=https:/배포url
Comment on lines
+32
to
+34
| if (backendResponse.status === 401) { | ||
| cookieStore.delete('refreshToken') | ||
| } |
Collaborator
There was a problem hiding this comment.
401 말고 다른 에러도 삭제하지 않는 이유가 궁금해요.
미인증말고 다른 곳도 삭제해야 서비스에 맞을 것 같다는 생각입니다.
Collaborator
Author
There was a problem hiding this comment.
동의합니다. 변경하겠습니다.
Collaborator
There was a problem hiding this comment.
be분들과 나눈 대화 봤는데 cors같아서 여기 헤더에 origin 추가하면 될 것 같아요
이건 서버 fetch라 origin이 안붙어서 생긴 에러 같습니다.
Origin: process.env.NEXT_PUBLIC_APP_URL!
| `${process.env.NEXT_PUBLIC_API_URL}/auth/login`, | ||
| { | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, |
Collaborator
There was a problem hiding this comment.
여기도 동일하게
Origin: process.env.NEXT_PUBLIC_APP_URL!,
origin 추가해보면 좋을 것 같아요
fa753c9 to
795f70d
Compare
헤더 origin추가 모든 에러에 대해 refreshToken을 삭제하도록
oy-sghooncho
approved these changes
May 11, 2026
oy-sghooncho
left a comment
Contributor
There was a problem hiding this comment.
코멘트 수정사항들은 확인했습니다! 동작 여부만 한 번 더 확인하고 머지하면 될 듯 해요
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
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.
📌 작업 개요
🗂 작업 유형
✏️ 작업 내용
app/auth/callback/route.ts — 백엔드 로그인 API 호출을 GET(쿼리 파라미터) → POST(JSON body)로 변경
app/auth/refresh/route.ts — reissue 응답에서 accessToken만 추출하도록 수정 (user 정보 제거)
app/auth/refresh/route.test.ts — reissue 응답 스펙 변경에 맞춰 테스트 수정
src/shared/api/mock/mockUser.ts — mockReissueResponse에서 userDetails, userChannelDetails 제거
src/features/auth/mock/mockAuth.ts — mockReissueResponse 타입을 reissue 스펙에 맞게 변경
src/pages/channel/ui/ChannelPage.tsx — KpiSection import 경로 대소문자 수정
✅ 셀프 체크리스트
💬 리뷰어에게