refactor(auth): migrate social login to next-auth
This commit is contained in:
+6
-13
@@ -1,7 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import localFont from "next/font/local";
|
||||
import Script from "next/script";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
import "./globals.css";
|
||||
|
||||
import { RootProviders } from "@/providers/root-providers";
|
||||
@@ -61,24 +61,17 @@ export default function RootLayout({
|
||||
}>) {
|
||||
return (
|
||||
// suppressHydrationWarning:next/font + Tailwind v4 偶发类名差异;详见
|
||||
// `src/lib/auth/use-auth-gate.tsx` 的"水合闪屏"说明。
|
||||
// `src/lib/auth/nextauth.ts` 的"水合闪屏"说明。
|
||||
<html
|
||||
lang="en"
|
||||
suppressHydrationWarning
|
||||
className={`${geistSans.variable} ${geistMono.variable} ${athelas.variable} h-full antialiased`}
|
||||
>
|
||||
<body className="min-h-full flex flex-col">
|
||||
{/* Facebook SDK JS(auth + splash 入口会用到 FB.login) */}
|
||||
<Script
|
||||
src="https://connect.facebook.net/en_US/sdk.js"
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
{/* Google Identity Services(auth 入口会用到 google.accounts.id) */}
|
||||
<Script
|
||||
src="https://accounts.google.com/gsi/client"
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
<RootProviders>{children}</RootProviders>
|
||||
{/* NextAuth SessionProvider:为所有客户端组件提供 useSession() 上下文 */}
|
||||
<SessionProvider>
|
||||
<RootProviders>{children}</RootProviders>
|
||||
</SessionProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user