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

This commit is contained in:
charles-gauthereau
2024-11-17 11:56:17 +01:00
parent cae096d249
commit ff9e3ffa67
+2
View File
@@ -11,6 +11,7 @@ import {prisma} from "@/prisma";
export default async function Layout({children}: { children: React.ReactNode }) {
const user = await currentUser()
console.log(user)
if(user){
const userInfo = await prisma.user.findUnique({
where: {
@@ -19,6 +20,7 @@ export default async function Layout({children}: { children: React.ReactNode })
})
if (!userInfo) redirect('/login')
}
if (!user) redirect('/login')
return (