From 01942ef86981614689bcec3e0014b430d513a6af Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 17 Feb 2025 10:36:20 +0800 Subject: [PATCH] tambahan .env.local --- run.env.local | 1 + run.prisma.env.local | 3 +++ src/app_modules/auth/invalid_user/view.tsx | 9 ++++++++- src/app_modules/forum/create/index.tsx | 6 ++---- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 run.env.local create mode 100644 run.prisma.env.local diff --git a/run.env.local b/run.env.local new file mode 100644 index 00000000..3e93d529 --- /dev/null +++ b/run.env.local @@ -0,0 +1 @@ +bun --env-file=.env.local run --bun dev \ No newline at end of file diff --git a/run.prisma.env.local b/run.prisma.env.local new file mode 100644 index 00000000..57a64842 --- /dev/null +++ b/run.prisma.env.local @@ -0,0 +1,3 @@ +bun --env-file=.env.local prisma db push +bun --env-file=.env.local prisma db seed +bun --env-file=.env.local run --bun build \ No newline at end of file diff --git a/src/app_modules/auth/invalid_user/view.tsx b/src/app_modules/auth/invalid_user/view.tsx index 737c74b1..fddda4a7 100644 --- a/src/app_modules/auth/invalid_user/view.tsx +++ b/src/app_modules/auth/invalid_user/view.tsx @@ -2,11 +2,13 @@ import { MainColor } from "@/app_modules/_global/color"; import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui"; -import { Button, Stack, Text, Title } from "@mantine/core"; +import { Button, Stack, Title } from "@mantine/core"; import { useRouter } from "next/navigation"; +import { useState } from "react"; export default function InvalidUser() { const router = useRouter(); + const [isLoading, setIsLoading] = useState(false); const deleteCookie = async () => { const sessionKey = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!; if (!sessionKey) { @@ -14,12 +16,15 @@ export default function InvalidUser() { } try { + setIsLoading(true); await fetch("/api/auth/logout", { method: "GET", }); router.push("/login"); } catch (error) { console.error("Gagal menghapus cookie:", error); + } finally { + setIsLoading(false); } }; @@ -32,6 +37,8 @@ export default function InvalidUser() { Invalid User