fixing routes

This commit is contained in:
2025-09-12 18:12:38 -06:00
parent e0a1058231
commit 43375ef5f8
45 changed files with 220 additions and 177 deletions
+15
View File
@@ -0,0 +1,15 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(request: NextRequest) {
const token = request.cookies.get('token');
if (!token) {
console.log('No hay token, redirigiendo a la página de inicio de sesión');
return NextResponse.redirect(new URL('/', request.url));
}
return NextResponse.next();
}
//IO