#Job done

## feat
- Fix bug login
### No issuue
This commit is contained in:
2024-03-01 14:36:02 +08:00
parent b1395a8ded
commit 0f2280f116
31 changed files with 698 additions and 192 deletions

View File

@@ -4,9 +4,9 @@ import { NextResponse } from "next/server";
import { cookies } from "next/headers";
import { sealData, unsealData } from "iron-session";
import { getConfig } from "@/bin/config";
import yaml from "yaml";
import fs from "fs";
import { revalidatePath } from "next/cache";
import fs from "fs";
import yaml from "yaml";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export async function POST(req: Request) {

View File

@@ -39,23 +39,23 @@ export async function GET(req: Request) {
});
}
for (let i of userSeeder) {
await prisma.user.upsert({
where: {
nomor: i.nomor,
},
create: {
nomor: i.nomor,
username: i.name,
masterUserRoleId: i.masterUserRoleId,
},
update: {
nomor: i.nomor,
username: i.name,
masterUserRoleId: i.masterUserRoleId,
},
});
}
// for (let i of userSeeder) {
// await prisma.user.upsert({
// where: {
// nomor: i.nomor,
// },
// create: {
// nomor: i.nomor,
// username: i.name,
// masterUserRoleId: i.masterUserRoleId,
// },
// update: {
// nomor: i.nomor,
// username: i.name,
// masterUserRoleId: i.masterUserRoleId,
// },
// });
// }
for (let i of bidangBisnis) {
await prisma.masterBidangBisnis.upsert({

View File

@@ -0,0 +1,14 @@
import { LayoutLogin } from "@/app_modules/auth";
import React from "react";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<LayoutLogin>{children}</LayoutLogin>
</>
);
}

View File

@@ -3,12 +3,10 @@ import { cookies } from "next/headers";
export default function Page() {
const c = cookies().getAll();
const tkn = c;
return (
<>
{/* {JSON.stringify(tkn)} */}
<Login />;
<Login />
</>
);
}

View File

@@ -0,0 +1,8 @@
import { Register } from "@/app_modules/auth";
import { auth_getKodeOtpById } from "@/app_modules/auth/fun/get_kode_otp_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let otpId = params.id
const dataOtp = await auth_getKodeOtpById(otpId)
return <Register dataOtp={dataOtp} />;
}

View File

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

View File

@@ -0,0 +1,9 @@
import { Validasi } from "@/app_modules/auth";
import { auth_getKodeOtpById } from "@/app_modules/auth/fun/get_kode_otp_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let kodeOtpId = params.id;
const dataOtp = await auth_getKodeOtpById(kodeOtpId);
return <Validasi dataOtp={dataOtp} />;
}

View File

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

View File

@@ -1,4 +0,0 @@
export function randomOTP(){
const random = Math.floor(Math.random() * (9000 - 1000 )) + 1000
return random;
}

View File

@@ -0,0 +1,5 @@
export const RouterAuth = {
login: "/dev/auth/login",
validasi: "/dev/auth/validasi/",
register: "/dev/auth/register/",
};