fix(auth): remove middleware self-fetch and SSL loop

This commit is contained in:
Schubert Ferenc 2026-07-12 11:01:19 +02:00
parent 9c6b184e39
commit 4f669a3426
345 changed files with 723 additions and 705 deletions

View file

@ -14,7 +14,7 @@ import {
UserRound
} from "lucide-react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { usePathname } from "next/navigation";
import { useEffect } from "react";
import { useAuth } from "@/components/auth";
import { BrandLogo } from "@/components/brand/brand-logo";
@ -47,16 +47,15 @@ function isActiveRoute(pathname: string, href: string) {
export function AppShell({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
const router = useRouter();
const auth = useAuth();
const showQuickstart = canStartValidation(auth.user?.role);
const quickstartActive = pathname === QUICKSTART_HREF;
useEffect(() => {
if (auth.user?.must_change_password && pathname !== "/profile/security") {
router.push("/profile/security");
window.location.replace("/profile/security");
}
}, [auth.user?.must_change_password, pathname, router]);
}, [auth.user?.must_change_password, pathname]);
return (
<div className="min-h-screen bg-background text-text">