feat
Deskripsi: - Create validasi - Create register - create global prisma, color tune,dan global state
This commit is contained in:
@@ -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 />;
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
5
src/app/dev/auth/register/page.tsx
Normal file
5
src/app/dev/auth/register/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Register } from "@/app_modules/auth";
|
||||
|
||||
export default function Page() {
|
||||
return <Register />;
|
||||
}
|
||||
@@ -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} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
5
src/app/dev/auth/validasi/page.tsx
Normal file
5
src/app/dev/auth/validasi/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Validasi } from "@/app_modules/auth";
|
||||
|
||||
export default function Page() {
|
||||
return <Validasi />;
|
||||
}
|
||||
@@ -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 />
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user