title: auto

des: auto
note:auto
This commit is contained in:
2023-10-03 11:00:16 +08:00
parent ab1bb590bf
commit fa46a3f055
7 changed files with 30 additions and 34 deletions

View File

@@ -3,7 +3,12 @@ import { useShallowEffect } from "@mantine/hooks";
import { cookies } from "next/headers";
import { useRouter } from "next/navigation";
import { useState } from "react";
import {unsealData} from "iron-session"
import { unsealData } from "iron-session";
import { getConfig } from "@/bin/config";
import yaml from "yaml";
import fs from "fs";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export default async function PageSplash() {
const c = cookies().get("ssn");
@@ -11,14 +16,12 @@ export default async function PageSplash() {
? null
: JSON.parse(
await unsealData(c.value as string, {
password: process.env.PWD as string,
password: (await getConfig()).server.password,
})
);
return (
<>
<SplashScreen data={tkn} />
</>
);