13 lines
343 B
TypeScript
13 lines
343 B
TypeScript
import { NextResponse, NextRequest } from 'next/server';
|
|||
|
|
|
||
|
|
const isLogin = true;
|
||
|
|
|
||
|
|
export function proxy(request: NextRequest) {
|
||
|
|
if (request.nextUrl.pathname !== '/login' && !isLogin) {
|
||
|
|
return NextResponse.redirect(new URL('/login', request.url));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export const config = {
|
||
|
|
matcher: ['/((?!api|_next/static|_next/image|.*\\.png$).*)']
|
||
|
|
};
|