title: auto

des: auto
note:auto
This commit is contained in:
2023-10-03 09:53:32 +08:00
parent 63c66d0c63
commit ac7a4162af

View File

@@ -1,3 +1,4 @@
import { getConfig } from '@/bin/config';
import { unsealData } from 'iron-session';
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
@@ -5,7 +6,7 @@ import { NextResponse } from "next/server";
export async function GET() {
const c = cookies().get("ssn");
const data = JSON.parse(
await unsealData(c?.value as string, {password: process.env.PWD as string})
await unsealData(c?.value as string, {password: ((await getConfig()).server.password)})
)
return NextResponse.json(data);