Skip to content

fix(auth): Next.js 15 미들웨어 JWT 인식 수정 - #118

Merged
evenif99 merged 1 commit into
mainfrom
fix/middleware-nextjs15
Jun 23, 2026
Merged

evenif99 merged 1 commit into
mainfrom
fix/middleware-nextjs15

Conversation

@evenif99

Copy link
Copy Markdown
Collaborator

Summary

  • next-auth/middleware 기본 export가 Next.js 15 Edge 런타임에서 JWT 토큰을 인식하지 못하는 문제 수정
  • 카카오 로그인 성공 후에도 보호 페이지 접근 시 미들웨어가 307로 로그인 페이지로 되돌려 보내는 버그 해결
  • getToken을 직접 호출하고 secureCookie 옵션을 명시적으로 설정
  • callbackUrl을 상대 경로(pathname)로 전달하여 절대 URL 리다이렉트 문제도 함께 해결

Test plan

  • 카카오 로그인 후 보호 페이지(감정일기, 마이페이지 등) 정상 접근 확인
  • 비회원 상태에서 보호 페이지 접근 시 로그인 페이지로 리다이렉트 확인
  • 로그인 후 원래 접근하려던 페이지로 정상 복귀 확인

🤖 Generated with Claude Code

next-auth/middleware 기본 export가 Next.js 15 Edge 런타임에서
JWT 토큰을 인식하지 못해 로그인 후에도 보호 페이지 접근 시
로그인 페이지로 되돌아가는 문제 해결.

- getToken을 직접 호출하고 secureCookie 옵션 명시 설정
- callbackUrl을 상대 경로(pathname)로 전달하여 절대 URL 문제 해결

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
talky-owl Ready Ready Preview, Comment Jun 23, 2026 12:32am

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • dev

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 68734a17-62e3-4e26-87fd-38fce44d19ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/middleware-nextjs15

Comment @coderabbitai help to get the list of available commands.

@evenif99
evenif99 merged commit 680f013 into main Jun 23, 2026
3 checks passed
@evenif99
evenif99 deleted the fix/middleware-nextjs15 branch June 23, 2026 00:32
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.

1 participant