Merge branch 'Lino' of https://github.com/jls846/front-censo into Sarabia
This commit is contained in:
@@ -8,6 +8,8 @@ import { usePathname } from "next/navigation";
|
||||
function Header() {
|
||||
const pathname = usePathname();
|
||||
|
||||
const rutasConBar = ["/escaner", "/AgregarEquipo"];
|
||||
|
||||
return (
|
||||
<header className={header.header}>
|
||||
<Link
|
||||
@@ -38,7 +40,7 @@ function Header() {
|
||||
alignItems: "end",
|
||||
}}
|
||||
>
|
||||
{pathname !== "/" && <BarNavigation />}
|
||||
{rutasConBar.includes(pathname) && <BarNavigation />}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
const token = request.cookies.get("token");
|
||||
const token = request.cookies.get("token")?.value;
|
||||
|
||||
if (!token) {
|
||||
console.log("No hay token, redirigiendo a la página de inicio de sesión");
|
||||
Reference in New Issue
Block a user