Working on settings Page. Adding init function on next.js startup.

This commit is contained in:
charles-gauthereau
2024-11-17 11:37:23 +01:00
parent b9a56188ae
commit 85ecfed50d
+10 -6
View File
@@ -12,13 +12,17 @@ export default async function Layout({children}: { children: React.ReactNode })
const user = await currentUser()
const userInfo = await prisma.user.findUnique({
where: {
email: user.email
}
})
if(user){
const userInfo = await prisma.user.findUnique({
where: {
email: user?.email
}
})
if (!userInfo) redirect('/login')
if(userInfo){
redirect('/login')
}
}
return (
<SidebarProvider>