tambahan .env.local

This commit is contained in:
2025-02-17 10:36:20 +08:00
parent b2edfc4924
commit 01942ef869
4 changed files with 14 additions and 5 deletions

1
run.env.local Normal file
View File

@@ -0,0 +1 @@
bun --env-file=.env.local run --bun dev

3
run.prisma.env.local Normal file
View File

@@ -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

View File

@@ -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
</Title>
<Button
loading={isLoading}
loaderPosition="center"
radius={"xl"}
onClick={() => {
deleteCookie();

View File

@@ -1,6 +1,5 @@
"use client";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import { Button, Group, Paper, Stack } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
@@ -21,11 +20,10 @@ const ReactQuill = dynamic(
);
import {
AccentColor,
MainColor,
MainColor
} from "@/app_modules/_global/color/color_pallet";
import mqtt_client from "@/util/mqtt_client";
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import mqtt_client from "@/util/mqtt_client";
const maxLength = 500;
export default function Forum_Create() {