authMiddleware() corrupts response cookies, only emits first one in local dev #1897
Closed
4 tasks done
Labels
bug
Something isn't working
nextjs
prioritized
This issue has been triaged and the team is working on it
Preliminary Checks
I have reviewed the documentation: https://clerk.com/docs
I have searched for existing issues: https://github.com/clerkinc/javascript/issues
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction / Replay Link
https://github.com/roev-co/clerk-corrupting-cookies
Publishable key
pk_test_c3VwZXJiLWdob3VsLTEzLmNsZXJrLmFjY291bnRzLmRldiQ
Description
Steps to reproduce
middleware.ts
withauthMiddleware()
usingafterAuth
callbackresponse.cookies.set()
to set 2 or more cookiesnext dev
Expected behavior:
Cookies get set.
Cookies parameters are set.
Actual behavior:
Only the first cookie gets set.
Parameters like
sameSite
andsecure
get ignored and not being sent to the browser.Background
next
.authMiddleware()
- works fine with vanila Next.js middleware functionRepro app
.env.local
npm install
next dev
first
second
third
, but it will only showfirst
Environment
The text was updated successfully, but these errors were encountered: