fix: update middleware to check MEETUP_SKIP_LOGIN environment variable before redirecting to login
Some checks failed
container-scan / Container Scan (pull_request) Successful in 5m3s
docker-build / docker (pull_request) Failing after 6m25s

This commit is contained in:
Maximilian Liebmann 2025-05-08 13:04:16 +02:00
parent aeff20589b
commit 0187b2e955

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