Correcting some bugs in statistics.

This commit is contained in:
charles-gauthereau
2025-02-14 09:25:45 +01:00
parent 8586abf7e5
commit d0ec5902b5
7 changed files with 8 additions and 87 deletions
+3 -10
View File
@@ -3,22 +3,15 @@ import {redirect} from "next/navigation";
import {SidebarInset, SidebarProvider} from "@/components/ui/sidebar"
import {AppSidebar} from "@/components/wrappers/dashboard/sideBar/app-sidebar";
import {currentUser} from "@/auth/current-user";
import {currentUser, requiredCurrentUser} from "@/auth/current-user";
import {Header} from "@/features/layout/Header";
import {prisma} from "@/prisma";
export default async function Layout({children}: { children: React.ReactNode }) {
const user = await currentUser()
if (user) {
const userInfo = await prisma.user.findUnique({
where: {
email: user?.email
}
})
if (!userInfo) redirect('/login')
}
const user = await requiredCurrentUser()
if (!user) redirect('/login')
return (