Desc:
- Penambahan function
- Perubahan tampilan
This commit is contained in:
2023-10-09 15:50:15 +08:00
parent 6281452441
commit ca66c3d2d8
12 changed files with 172 additions and 96 deletions

View File

@@ -4,22 +4,23 @@ import { unsealData } from "iron-session";
import _ from "lodash";
import { redirect } from "next/navigation";
import yaml from "yaml";
import fs from "fs";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export default async function Page() {
const c = cookies().get("ssn");
// const tkn = !c
// ? null
// : JSON.parse(
// await unsealData(c.value as string, {
// password: process.env.PWD as string,
// })
// );
// if (!c?.value) return redirect("/dev/auth/login");
if (!c?.value) return redirect("/dev/auth/login");
const usr = JSON.parse(
await unsealData(c?.value as string, {
password: config.server.password,
})
);
return (
<>
{/* {JSON.stringify(tkn)} */}
<HomeView />
<HomeView user={usr} />
</>
);
}