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 { ThemeProvider } from "next-themes";
|
||||||
import { ModeToggle } from "@/components/mode-toggle";
|
import { ModeToggle } from "@/components/mode-toggle";
|
||||||
import SignIn from "@/components/sign-in";
|
import SignIn from "@/components/sign-in";
|
||||||
import AuthSessionProvider from "@/components/SessionProvider";
|
|
||||||
import { Toaster } from "@/components/ui/sonner";
|
import { Toaster } from "@/components/ui/sonner";
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
|
|
||||||
@@ -28,28 +27,26 @@ export default function RootLayout({
|
|||||||
<body
|
<body
|
||||||
className={`${geist.variable} antialiased min-h-screen flex flex-col dark:text-gray-300 --color-background`}
|
className={`${geist.variable} antialiased min-h-screen flex flex-col dark:text-gray-300 --color-background`}
|
||||||
>
|
>
|
||||||
<AuthSessionProvider>
|
<ThemeProvider
|
||||||
<ThemeProvider
|
attribute="class"
|
||||||
attribute="class"
|
defaultTheme="system"
|
||||||
defaultTheme="system"
|
enableSystem
|
||||||
enableSystem
|
disableTransitionOnChange
|
||||||
disableTransitionOnChange
|
>
|
||||||
>
|
<header className="dark:text-white text-gray-900 px-4 py-3 font-bold flex justify-between items-center-safe">
|
||||||
<header className="dark:text-white text-gray-900 px-4 py-3 font-bold flex justify-between items-center-safe">
|
<Link href={"/"}>
|
||||||
<Link href={"/"}>
|
<p className={`${magra.variable}`}>
|
||||||
<p className={`${magra.variable}`}>
|
{metadata.title as string || "iCal PWA"}
|
||||||
{metadata.title as string || "iCal PWA"}
|
</p>
|
||||||
</p>
|
</Link>
|
||||||
</Link>
|
<div className="flex flex-row gap-2">
|
||||||
<div className="flex flex-row gap-2">
|
<SignIn />
|
||||||
<SignIn />
|
<ModeToggle />
|
||||||
<ModeToggle />
|
</div>
|
||||||
</div>
|
</header>
|
||||||
</header>
|
<main className="flex-1 p-4">{children}</main>
|
||||||
<main className="flex-1 p-4">{children}</main>
|
<Toaster closeButton richColors />
|
||||||
<Toaster closeButton richColors />
|
</ThemeProvider>
|
||||||
</ThemeProvider>
|
|
||||||
</AuthSessionProvider>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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