fix: add SessionProvider to fix useSession SSR crash
Some checks failed
Build & Deploy Dashboard / deploy (push) Failing after 1m2s

This commit is contained in:
Cosmo
2026-04-16 09:02:07 +00:00
parent 150a8fbf55
commit ac279a672d
4 changed files with 15 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
import { Sidebar } from "@/components/layout/Sidebar";
export const dynamic = "force-dynamic";
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
return (
<div className="flex h-screen bg-[#080810] overflow-hidden">

View File

@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import "./globals.css";
import { Providers } from "./providers";
export const metadata: Metadata = {
title: "Digital Home",
@@ -16,7 +17,9 @@ export default function RootLayout({
}>) {
return (
<html lang="ru" className="dark">
<body style={{fontFamily: 'system-ui, -apple-system, sans-serif'}}>{children}</body>
<body style={{fontFamily: 'system-ui, -apple-system, sans-serif'}}>
<Providers>{children}</Providers>
</body>
</html>
);
}

6
src/app/providers.tsx Normal file
View File

@@ -0,0 +1,6 @@
"use client";
import { SessionProvider } from "next-auth/react";
export function Providers({ children }: { children: React.ReactNode }) {
return <SessionProvider>{children}</SessionProvider>;
}