refactor(auth): remove unused SessionProvider wrapper
Remove the passthrough AuthSessionProvider component and its usage in layout. better-auth hooks work without a provider wrapper.
This commit is contained in:
@@ -4,7 +4,6 @@ import "./globals.css";
|
||||
import { ThemeProvider } from "next-themes";
|
||||
import { ModeToggle } from "@/components/mode-toggle";
|
||||
import SignIn from "@/components/sign-in";
|
||||
import AuthSessionProvider from "@/components/SessionProvider";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
import Link from "next/link"
|
||||
|
||||
@@ -28,28 +27,26 @@ export default function RootLayout({
|
||||
<body
|
||||
className={`${geist.variable} antialiased min-h-screen flex flex-col dark:text-gray-300 --color-background`}
|
||||
>
|
||||
<AuthSessionProvider>
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<header className="dark:text-white text-gray-900 px-4 py-3 font-bold flex justify-between items-center-safe">
|
||||
<Link href={"/"}>
|
||||
<p className={`${magra.variable}`}>
|
||||
{metadata.title as string || "iCal PWA"}
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex flex-row gap-2">
|
||||
<SignIn />
|
||||
<ModeToggle />
|
||||
</div>
|
||||
</header>
|
||||
<main className="flex-1 p-4">{children}</main>
|
||||
<Toaster closeButton richColors />
|
||||
</ThemeProvider>
|
||||
</AuthSessionProvider>
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<header className="dark:text-white text-gray-900 px-4 py-3 font-bold flex justify-between items-center-safe">
|
||||
<Link href={"/"}>
|
||||
<p className={`${magra.variable}`}>
|
||||
{metadata.title as string || "iCal PWA"}
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex flex-row gap-2">
|
||||
<SignIn />
|
||||
<ModeToggle />
|
||||
</div>
|
||||
</header>
|
||||
<main className="flex-1 p-4">{children}</main>
|
||||
<Toaster closeButton richColors />
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { ReactNode } from "react"
|
||||
|
||||
interface Props {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export default function AuthSessionProvider({ children }: Props) {
|
||||
return <>{children}</>
|
||||
}
|
||||
Reference in New Issue
Block a user