title: auto
des: auto note:auto
This commit is contained in:
@@ -4,8 +4,10 @@ import prisma from "@/app/lib/prisma";
|
||||
import { data } from "autoprefixer";
|
||||
import { NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
import { getConfig } from "@/bin/config";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
|
||||
if (req.method === "POST") {
|
||||
const body = await req.json();
|
||||
// MyConsole(body);
|
||||
@@ -35,7 +37,7 @@ export async function POST(req: Request) {
|
||||
username: data.username,
|
||||
}),
|
||||
{
|
||||
password: process.env.PWD as string,
|
||||
password: (await getConfig()).server.password,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -45,8 +47,7 @@ export async function POST(req: Request) {
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
});
|
||||
|
||||
|
||||
return NextResponse.json({ status: 201});
|
||||
return NextResponse.json({ status: 201 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
|
||||
@@ -3,6 +3,7 @@ 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";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
@@ -30,7 +31,7 @@ export async function POST(req: Request) {
|
||||
username: data.username,
|
||||
}),
|
||||
{
|
||||
password: process.env.PWD as string,
|
||||
password: (await getConfig()).server.password,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user