fix: lagg till SessionProvider i root layout sa useSession() fungerar
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { SessionProvider } from 'next-auth/react';
|
||||||
|
|
||||||
|
export default function Providers({ children }: { children: React.ReactNode }) {
|
||||||
|
return <SessionProvider>{children}</SessionProvider>;
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user