#Job done
## feat - Fix bug login ### No issuue
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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({
|
||||
|
||||
14
src/app/dev/auth/login/layout.tsx
Normal file
14
src/app/dev/auth/login/layout.tsx
Normal 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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -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 />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
8
src/app/dev/auth/register/[id]/page.tsx
Normal file
8
src/app/dev/auth/register/[id]/page.tsx
Normal 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} />;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import { Register } from "@/app_modules/auth";
|
||||
|
||||
export default function Page() {
|
||||
return <Register />;
|
||||
}
|
||||
9
src/app/dev/auth/validasi/[id]/page.tsx
Normal file
9
src/app/dev/auth/validasi/[id]/page.tsx
Normal 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} />;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { Validasi } from "@/app_modules/auth";
|
||||
|
||||
|
||||
export default function Page() {
|
||||
|
||||
return <Validasi />;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export function randomOTP(){
|
||||
const random = Math.floor(Math.random() * (9000 - 1000 )) + 1000
|
||||
return random;
|
||||
}
|
||||
5
src/app/lib/router_hipmi/router_auth.ts
Normal file
5
src/app/lib/router_hipmi/router_auth.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const RouterAuth = {
|
||||
login: "/dev/auth/login",
|
||||
validasi: "/dev/auth/validasi/",
|
||||
register: "/dev/auth/register/",
|
||||
};
|
||||
Reference in New Issue
Block a user