init repo

This commit is contained in:
JIANG
2025-09-09 10:01:21 +08:00
commit d70d1709d3
34 changed files with 13652 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import authOptions from "@app/api/auth/[...nextauth]/options";
import { Header } from "@components/header";
import { ThemedLayout } from "@refinedev/mui";
import { getServerSession } from "next-auth/next";
import { redirect } from "next/navigation";
import React from "react";
export default async function Layout({ children }: React.PropsWithChildren) {
const data = await getData();
if (!data.session?.user) {
return redirect("/login");
}
return <ThemedLayout Header={Header}>{children}</ThemedLayout>;
}
async function getData() {
const session = await getServerSession(authOptions);
return {
session,
};
}