Deskripsi:
- Create validasi
- Create register
- create global prisma, color tune,dan global state
This commit is contained in:
2023-10-02 22:13:08 +08:00
parent 193dc27e9c
commit cf6aaf500e
32 changed files with 1094 additions and 97 deletions

View File

@@ -1,9 +1,14 @@
import { Login } from "@/app_modules/auth";
import { cookies } from "next/headers";
export default function Page() {
const c = cookies().getAll();
const tkn = c;
return (
<>
<Login />
{JSON.stringify(tkn)}
<Login />;
</>
);
}

View File

@@ -0,0 +1,5 @@
import { Register } from "@/app_modules/auth";
export default function Page() {
return <Register />;
}

View File

@@ -1,12 +1,25 @@
import { SplashScreen } from "@/app_modules/auth";
import { useShallowEffect } from "@mantine/hooks";
import { cookies } from "next/headers";
import { useRouter } from "next/navigation";
import { useState } from "react";
import {unsealData} from "iron-session"
export default async function PageSplash() {
const c = cookies().get("ssn");
const tkn = !c
? null
: JSON.parse(
await unsealData(c.value as string, {
password: process.env.PWD as string,
})
);
export default function PageSplash() {
return (
<>
<SplashScreen />
<SplashScreen data={tkn} />
</>
);
}

View File

@@ -0,0 +1,5 @@
import { Validasi } from "@/app_modules/auth";
export default function Page() {
return <Validasi />;
}

View File

@@ -1,8 +1,24 @@
import { HomeView } from "@/app_modules/home";
import { cookies } from "next/headers";
import { unsealData } from "iron-session";
import _ from "lodash";
import { redirect } from "next/navigation";
export default async function Page() {
const c = cookies().get("ssn");
const tkn = !c
? null
: JSON.parse(
await unsealData(c.value as string, {
password: process.env.PWD as string,
})
);
if (!c?.value) return redirect("/dev/auth/login");
export default function Page() {
return (
<>
{/* {JSON.stringify(tkn)} */}
<HomeView />
</>
);