fix: update middleware to check MEETUP_SKIP_LOGIN environment variable before redirecting to login
This commit is contained in:
parent
aeff20589b
commit
0187b2e955
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,11 @@
|
||||||
import { auth } from '@/auth';
|
import { auth } from '@/auth';
|
||||||
|
|
||||||
export default auth((req) => {
|
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);
|
const newUrl = new URL('/login', req.nextUrl.origin);
|
||||||
return Response.redirect(newUrl);
|
return Response.redirect(newUrl);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue