feat: tambah dependensi 'jose' versi 5.9.2 pada package.json

refactor: rapikan identasi dan buat field 'expires' opsional di model UserSession pada schema prisma

chore: bersihkan import tidak terpakai di route login dan register API
This commit is contained in:
2024-09-18 14:39:39 +08:00
parent 2ccbca6566
commit 6ee43ed20f
83 changed files with 794 additions and 273 deletions

View File

@@ -0,0 +1,27 @@
"use client";
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
export function CheckCookies_UiLayout({
children,
}: {
children: React.ReactNode;
}) {
const router = useRouter();
useShallowEffect(() => {
onCheckCookies();
}, []);
async function onCheckCookies() {
const cek = await fetch("/api/check-cookies");
const result = await cek.json();
if (result.success === false) {
router.push(RouterAuth.login);
}
}
return <>{children}</>;
}