From 0187b2e955432af2972ccf24eb0dde808f87d711 Mon Sep 17 00:00:00 2001 From: SomeCodecat <88855796+SomeCodecat@users.noreply.github.com> Date: Thu, 8 May 2025 13:04:16 +0200 Subject: [PATCH] fix: update middleware to check MEETUP_SKIP_LOGIN environment variable before redirecting to login --- src/middleware.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/middleware.ts b/src/middleware.ts index e03128a..e6e663d 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,7 +1,11 @@ import { auth } from '@/auth'; export default auth((req) => { - if (!req.auth && req.nextUrl.pathname !== '/login') { + if ( + !req.auth && + req.nextUrl.pathname !== '/login' && + process.env.MEETUP_SKIP_LOGIN === 'true' + ) { const newUrl = new URL('/login', req.nextUrl.origin); return Response.redirect(newUrl); }