mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on settings Page. Adding init function on next.js startup.
This commit is contained in:
@@ -12,13 +12,17 @@ export default async function Layout({children}: { children: React.ReactNode })
|
|||||||
|
|
||||||
const user = await currentUser()
|
const user = await currentUser()
|
||||||
|
|
||||||
const userInfo = await prisma.user.findUnique({
|
if(user){
|
||||||
where: {
|
const userInfo = await prisma.user.findUnique({
|
||||||
email: user.email
|
where: {
|
||||||
}
|
email: user?.email
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if (!userInfo) redirect('/login')
|
if(userInfo){
|
||||||
|
redirect('/login')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
|
|||||||
Reference in New Issue
Block a user