Fix flaw in authentication check

This commit is contained in:
2026-01-17 17:06:12 +07:00 Unverified
parent 75405ade99
commit c0e389c047
4 changed files with 12 additions and 5 deletions
+4
View File
@@ -50,12 +50,16 @@ import { NavUser } from "@/components/user";
import { db } from "@/lib/db";
import { versions } from "@/lib/db/schema";
import { SidebarLink, VersionCreateDialogForm } from "./client";
import { adminCheck } from "@/lib/auth";
import { redirect } from "next/navigation";
export default async function AdminLayout({
children,
}: {
children: ReactNode;
}) {
if(!await adminCheck()) redirect("/login");
const vers = await db
.select()
.from(versions)