We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c04d62 commit 74df7d8Copy full SHA for 74df7d8
1 file changed
src/middleware.ts
@@ -245,10 +245,9 @@ export async function middleware(req: NextRequest) {
245
: "next-auth.session-token",
246
});
247
248
- if (!token) {
+ if (!token && !isProduction) {
249
// Fallback: try the opposite cookie name to handle edge cases such as
250
- // a production build served over HTTP (e.g. a staging environment without TLS)
251
- // or a dev build that somehow received a Secure cookie.
+ // a dev build that somehow received a Secure cookie.
252
token = await getToken({
253
req,
254
secret: process.env.NEXTAUTH_SECRET,
0 commit comments