Skip to content
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

fix(docs): add middleware prerequisite #10667

Conversation

JasperAlexander
Copy link
Contributor

☕️ Reasoning

Currently, the Next.js middleware only supports the jwt session strategy. When using an adapter, the default session strategy is database. It is not well documented that you need to set the session strategy to jwt when using an adapter in order to use the middleware. I added this to the docs.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes: #10276

📌 Resources

Copy link

vercel bot commented Apr 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Apr 21, 2024 10:44am
next-auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2024 10:44am

@ndom91
Copy link
Member

ndom91 commented Apr 21, 2024

@JasperAlexander unfortunately this is not the case, you can use the database session with middleware, as long as you use a database who is edge runtime compatible.

Check out my reply to the other thread you posted in: #8161 (comment)

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.

2 participants