Test server
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { sealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export async function Auth_funRegister(data: any) {
|
||||
|
||||
const cekUsername = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: data.username,
|
||||
@@ -35,7 +34,7 @@ export async function Auth_funRegister(data: any) {
|
||||
username: create.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { sealData } from "iron-session";
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
import { cookies } from "next/headers";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
|
||||
|
||||
export async function auth_funValidasi(nomor: string) {
|
||||
const cek = await prisma.user.findUnique({
|
||||
@@ -30,7 +29,7 @@ export async function auth_funValidasi(nomor: string) {
|
||||
username: cek.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
Center,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
@@ -56,22 +56,6 @@ export default function Login() {
|
||||
// },
|
||||
// body: JSON.stringify(body),
|
||||
// })
|
||||
// .then((res) => res.json())
|
||||
// .then((val) => {
|
||||
// // console.log(val);
|
||||
// if (val.success === true) {
|
||||
// router.push(RouterAdminDashboard.splash_admin);
|
||||
// } else {
|
||||
// if (val.status == 200) {
|
||||
// setCode(val.body.otp);
|
||||
// setInputNumber(val.body.nomor);
|
||||
// router.push("/dev/auth/validasi");
|
||||
// return NotifBerhasil("Nomor OTP terkirim");
|
||||
// } else {
|
||||
// NotifGagal(val.message);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user