carservice: initial commit
Build and publish images / docker (push) Canceled after 0s

This commit is contained in:
Hermes
2026-07-20 20:51:23 +01:00
commit f7a9906add
77 changed files with 9403 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
"use client";
import { useEffect, useState } from "react";
import { useRouter, usePathname } from "next/navigation";
export default function AuthGuard({ children }: { children: React.ReactNode }) {
const router = useRouter();
const pathname = usePathname();
const [checked, setChecked] = useState(false);
useEffect(() => {
if (pathname === "/login") {
setChecked(true);
return;
}
const user = localStorage.getItem("user");
if (!user) {
router.push("/login");
} else {
setChecked(true);
}
}, [pathname, router]);
if (!checked) {
return <div className="min-h-screen bg-steel-100 dark:bg-steel-900" />;
}
return <>{children}</>;
}