feat: Add the support of custom cookieName on the next-auth/middleware#4385
feat: Add the support of custom cookieName on the next-auth/middleware#4385balazsorban44 merged 5 commits intonextauthjs:mainfrom
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/55C7fRvzBuBHV8CUbuEHBE3x16Gs [Deployment for f942064 canceled] |
balazsorban44
left a comment
There was a problem hiding this comment.
Thank you!
My end goal is to match the API of NextAuth within Middleware (so once we are fully edge-compatible, we can reduce the public API surface again, probably in v5), so I appreciate that you used the same API.
As for the docs, I think we should use what's already in https://next-auth.js.org/configuration/options#cookies
Removing the parts that aren't configurable right now.
It looks good to me otherwise. Were you actually be able to test it out?
Done 🎉
Don't find the middleware testing file to add more tests, any help about implementation of it will be appreciate |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reasoning 💡
When using the advanced custom cookie feature in next-auth, the middleware no longer works due to the fact that it looks for the default names of next-auth. The middleware calls
getTokenwithout allowing to override the cookie nameChecklist 🧢
Affected issues 🎟
No
Notes
Try to following the work done in this PR to make more flexible merge in the future #4210