add redirect from './'

This commit is contained in:
smanylov
2025-12-02 17:15:09 +07:00
parent 6d47fa7fbb
commit a8b7495d1e
+6 -2
View File
@@ -16,10 +16,14 @@ export default async function proxy(request: NextRequest) {
const session = await decrypt(cookie); const session = await decrypt(cookie);
if (isProtectedRoute && !session?.token) { if (isProtectedRoute && !session?.token) {
return NextResponse.redirect(new URL('/login', request.nextUrl)) return NextResponse.redirect(new URL('/login', request.nextUrl));
} }
return NextResponse.next(); if (path === '/') {
return NextResponse.redirect(new URL('/pages/dashboard', request.nextUrl));
}
return NextResponse.next();
} }
export const config = { export const config = {