Test server

This commit is contained in:
2024-09-17 08:51:27 +08:00
parent 2fef481e2f
commit 2ccbca6566
21 changed files with 51 additions and 137 deletions

View File

@@ -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
}
);

View File

@@ -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,
}
);