This commit is contained in:
hailin 2025-04-21 13:47:23 +08:00
parent ab92b72206
commit 341ca458b8
1 changed files with 8 additions and 5 deletions

View File

@ -82,10 +82,13 @@ export default async function RootLayout({
}
}
)
const session = (await supabase.auth.getSession()).data.session
console.log("[layout.tsx]Session Data: ", sessionData)
console.log("[layout.tsx]Session Error: ", sessionError)
// const session = (await supabase.auth.getSession()).data.session
const { data, error } = await supabase.auth.getSession();
if (error) {
console.log("[layout.tsx]Session Error: ", error);
} else {
console.log("[layout.tsx]Session Data: ", data.session);
}
const { t, resources } = await initTranslations(locale, i18nNamespaces)
@ -102,7 +105,7 @@ export default async function RootLayout({
>
<Toaster richColors position="top-center" duration={3000} />
<div className="bg-background text-foreground flex h-dvh flex-col items-center overflow-x-auto">
{session ? <GlobalState>{children}</GlobalState> : children}
{data.session ? <GlobalState>{children}</GlobalState> : children}
</div>
</TranslationsProvider>
</Providers>