fix: update middleware to check MEETUP_SKIP_LOGIN environment variable before redirecting to login
All checks were successful
container-scan / Container Scan (pull_request) Successful in 1m57s
docker-build / docker (pull_request) Successful in 5m30s

This commit is contained in:
Maximilian Liebmann 2025-05-08 13:04:16 +02:00
parent 0880c70c2e
commit bf93e5d7f0

View file

@ -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);
}