title: auto

des: auto
note:auto
This commit is contained in:
2023-10-03 10:22:31 +08:00
parent 64a3ce9a25
commit ab1bb590bf
3 changed files with 43 additions and 13 deletions

View File

@@ -0,0 +1,16 @@
"use server";
import prisma from "@/app/lib/prisma";
import { getConfig } from "@/bin/config";
import { unsealData } from "iron-session";
import { cookies } from "next/headers";
export async function getToken() {
const c = cookies().get("ssn");
const token = await unsealData(c?.value as string, {
password: (await getConfig()).server.password,
});
return token
}