Add authenticated login and SSO protection

This commit is contained in:
inman
2026-05-29 15:54:13 +08:00
parent e36f28a668
commit 0648874801
50 changed files with 1853 additions and 63 deletions

View File

@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import { AppShell } from "@/components/app-shell";
import { getShellAuthState } from "@/lib/server/auth/current-user";
import "./globals.css";
export const metadata: Metadata = {
@@ -7,11 +8,12 @@ export const metadata: Metadata = {
description: "智念AIGC平台统一创作图片、视频、局部重绘与智能超清。"
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const auth = await getShellAuthState();
return (
<html lang="zh-CN">
<body>
<AppShell>{children}</AppShell>
<AppShell user={auth.user} authRequired={auth.authRequired}>{children}</AppShell>
</body>
</html>
);