feat: 配置 NextAuth.js 认证系统
- 支持邮箱密码登录 - 支持 Magic Link 登录(Resend) - 配置 Session Provider - 添加 TypeScript 类型定义
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import NextAuth from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
+8
-5
@@ -6,6 +6,7 @@ import { WebVitals } from "@/components/analytics/web-vitals";
|
||||
import { OrganizationSchema, WebsiteSchema } from "@/components/seo/structured-data";
|
||||
import { MobileTabBar } from "@/components/layout/mobile-tab-bar";
|
||||
import { ErrorBoundary } from "@/components/ui/error-boundary";
|
||||
import { SessionProvider } from "@/providers/session-provider";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
@@ -136,11 +137,13 @@ export default function RootLayout({
|
||||
style={{ fontFamily: "'Noto Sans SC', 'Geist', -apple-system, BlinkMacSystemFont, sans-serif" }}
|
||||
>
|
||||
<WebVitals />
|
||||
<ThemeProvider>
|
||||
<ErrorBoundary>
|
||||
{children}
|
||||
</ErrorBoundary>
|
||||
</ThemeProvider>
|
||||
<SessionProvider>
|
||||
<ThemeProvider>
|
||||
<ErrorBoundary>
|
||||
{children}
|
||||
</ErrorBoundary>
|
||||
</ThemeProvider>
|
||||
</SessionProvider>
|
||||
<MobileTabBar />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user