mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-03 00:26:40 +08:00
25 lines
566 B
TypeScript
25 lines
566 B
TypeScript
import { Analytics } from "@vercel/analytics/react";
|
|
|
|
import { Home } from "./components/home";
|
|
|
|
import { getServerSideConfig } from "./config/server";
|
|
|
|
import { getSession, isName } from "@/lib/auth";
|
|
import { redirect } from "next/navigation";
|
|
|
|
const serverConfig = getServerSideConfig();
|
|
|
|
export default async function App() {
|
|
const session = await getSession();
|
|
if (!session || !(session?.user?.name && isName(session.user.name))) {
|
|
redirect("/login");
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Home />
|
|
{serverConfig?.isVercel && <Analytics />}
|
|
</>
|
|
);
|
|
}
|