update condition for production redirect

This commit is contained in:
Danel Kungla
2025-09-09 15:25:31 +03:00
parent ebab0556ba
commit 86a5931b66

View File

@@ -182,7 +182,11 @@ function getPatterns() {
return NextResponse.redirect(
new URL(pathsConfig.app.home, req.nextUrl.origin).href,
);
} else if (process.env.NODE_ENV === 'production') {
} else if (
!['test', 'localhost'].some((pathString) =>
process.env.NEXT_PUBLIC_SITE_URL?.includes(pathString),
)
) {
return NextResponse.redirect(
new URL('https://medreport.ee', req.nextUrl.origin).href,
);