fixed navbar

This commit is contained in:
2026-01-12 13:57:08 -06:00
parent e573755df3
commit 4d56b54bf0
4 changed files with 8 additions and 7 deletions
+3 -2
View File
@@ -40,8 +40,9 @@ function Header() {
<div className={header.yellowPart}></div>
<div className={header.containerBarNav}>
{role === "ADMINISTRADOR" && <BarNavigation />}
{/*role === "operator" && <OperatorBarNavigation />*/}
{/*role === "social" && <SocialServiceBarNavigation />*/}
{role === "SUPER ADMINISTRADOR (quita sanciones)" && <BarNavigation />}
{role === "SERVICIO SOCIAL" && <BarNavigation/>}
{role === "ATENCION A USUARIO" && <BarNavigation/>}
</div>
</header>
);
+3 -3
View File
@@ -5,11 +5,11 @@ export function middleware(request: NextRequest) {
const token = request.cookies.get("token")?.value;
const pathname = request.nextUrl.pathname;
if (pathname === "/") {
return NextResponse.next();
if (pathname === "/" && token) {
return NextResponse.redirect(new URL("/Impresiones", request.url));
}
if (!token) {
if (!token && pathname != "/") {
console.log("No hay token, redirigiendo a login");
return NextResponse.redirect(new URL("/", request.url));
}
+1 -1
View File
@@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "source ~/.nvm/nvm.sh && node --version && nvm use 22.10.0 && npm install && next build && next start -p 3356",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
+1 -1
View File
@@ -15,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "preserve",
"incremental": true,
"plugins": [
{