added and fixed minor details

This commit is contained in:
2026-05-30 00:02:55 +02:00
parent 1d7fb194fa
commit b435b5f638
6 changed files with 198 additions and 8 deletions
+16 -4
View File
@@ -1,9 +1,21 @@
import { createFileRoute } from '@tanstack/react-router'
import { isAuthenticated } from "../utils/auth";
import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute('/')({
export const Route = createFileRoute("/")({
beforeLoad: async () => {
if (!(await isAuthenticated())) {
throw redirect({
to: "/login",
});
} else {
throw redirect({
to: "/app/inventory",
});
}
},
component: RouteComponent,
})
});
function RouteComponent() {
return <div>Index "/"!</div>
return;
}