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,9 @@
import { sealData } from "iron-session";
import { myConsole } from "@/app/fun/my_console";
import { PwdCookies } from "@/app/lib";
import prisma from "@/app/lib/prisma";
import { data } from "autoprefixer";
import { NextResponse } from "next/server";
import { sealData } from "iron-session";
import { cookies } from "next/headers";
import { getConfig } from "@/bin/config";
import fs from "fs";
import yaml from "yaml";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
import { NextResponse } from "next/server";
export async function POST(req: Request) {
if (req.method === "POST") {
@@ -40,7 +35,7 @@ export async function POST(req: Request) {
username: data.username,
}),
{
password: await config.server.password,
password: PwdCookies,
}
);

View File

@@ -1,13 +1,10 @@
import { myConsole } from "@/app/fun/my_console";
import { PwdCookies } from "@/app/lib";
import prisma from "@/app/lib/prisma";
import { NextResponse } from "next/server";
import { cookies } from "next/headers";
import { sealData, unsealData } from "iron-session";
import { getConfig } from "@/bin/config";
import { sealData } from "iron-session";
import { revalidatePath } from "next/cache";
import fs from "fs";
import yaml from "yaml";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
if (req.method === "POST") {
@@ -36,7 +33,7 @@ export async function POST(req: Request) {
username: data.username,
}),
{
password: await config.server.password,
password: await PwdCookies,
}
);