fix: lagg till SessionProvider i root layout sa useSession() fungerar

This commit is contained in:
Nils-Johan Gynther
2026-04-19 21:55:22 +02:00
parent 0f71d2569b
commit 01d1bd2639
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
'use client';
import { SessionProvider } from 'next-auth/react';
export default function Providers({ children }: { children: React.ReactNode }) {
return <SessionProvider>{children}</SessionProvider>;
}
+2 -1
View File
@@ -1,4 +1,5 @@
import type { Metadata } from 'next'; import type { Metadata } from 'next';
import Providers from './Providers';
export const metadata: Metadata = { export const metadata: Metadata = {
title: 'Recipe App', title: 'Recipe App',
@@ -13,7 +14,7 @@ export default function RootLayout({
return ( return (
<html lang="sv"> <html lang="sv">
<body style={{ fontFamily: 'Arial, sans-serif', margin: 0 }}> <body style={{ fontFamily: 'Arial, sans-serif', margin: 0 }}>
{children} <Providers>{children}</Providers>
</body> </body>
</html> </html>
); );