Skip to content

refactor(login): 로그인 로직 수정(GET->POST)에 따른 수정 #107

Merged
kimYunHyeong merged 26 commits into
developfrom
feature/login
May 11, 2026
Merged

refactor(login): 로그인 로직 수정(GET->POST)에 따른 수정 #107
kimYunHyeong merged 26 commits into
developfrom
feature/login

Conversation

@kimYunHyeong

Copy link
Copy Markdown
Collaborator

📌 작업 개요

로그인 로직 수정(GET->POST)에 따른 수정

🗂 작업 유형

해당하는 항목에 x를 채워 주세요.

  • [] 기능 추가 (feat)
  • 버그 수정 (fix)
  • 리팩토링 (refactor)
  • 스타일 / UI 수정 (style)
  • 성능 개선 (perf)
  • 테스트 (test)
  • 기타 (chore, docs 등)

✏️ 작업 내용

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 경로 대소문자 수정

✅ 셀프 체크리스트

머지 전 직접 확인해 주세요.

  • 로컬에서 정상 동작 확인
  • 불필요한 콘솔 로그, 주석, 디버그 코드 제거
  • 타입 에러 없음

💬 리뷰어에게

kimYunHyeong and others added 12 commits May 7, 2026 01:56
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적용
@vercel

vercel Bot commented May 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inflace Ready Ready Preview, Comment May 10, 2026 2:50pm

Comment thread app/auth/callback/route.ts Outdated
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>

@shunn2 shunn2 May 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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 thread app/auth/refresh/route.ts Outdated
Comment on lines +32 to +34
if (backendResponse.status === 401) {
cookieStore.delete('refreshToken')
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

401 말고 다른 에러도 삭제하지 않는 이유가 궁금해요.
미인증말고 다른 곳도 삭제해야 서비스에 맞을 것 같다는 생각입니다.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동의합니다. 변경하겠습니다.

Comment thread app/auth/refresh/route.ts Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be분들과 나눈 대화 봤는데 cors같아서 여기 헤더에 origin 추가하면 될 것 같아요
이건 서버 fetch라 origin이 안붙어서 생긴 에러 같습니다.
Origin: process.env.NEXT_PUBLIC_APP_URL!

Comment thread app/auth/callback/route.ts Outdated
`${process.env.NEXT_PUBLIC_API_URL}/auth/login`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 동일하게
Origin: process.env.NEXT_PUBLIC_APP_URL!,
origin 추가해보면 좋을 것 같아요

헤더 origin추가
모든 에러에 대해 refreshToken을 삭제하도록

@oy-sghooncho oy-sghooncho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코멘트 수정사항들은 확인했습니다! 동작 여부만 한 번 더 확인하고 머지하면 될 듯 해요

@kimYunHyeong kimYunHyeong merged commit e85d872 into develop May 11, 2026
2 checks passed
@kimYunHyeong kimYunHyeong deleted the feature/login branch May 31, 2026 15:51
@kimYunHyeong kimYunHyeong restored the feature/login branch May 31, 2026 15:51
@kimYunHyeong kimYunHyeong deleted the feature/login branch June 11, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants