From 87304153526200a2c3340c433c87348d5199287b Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Sat, 9 Mar 2024 23:13:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=9A=E8=BF=87=E5=88=A4=E6=96=ADuser?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E7=99=BB=E9=99=86=E6=9D=A5=E5=86=B3=E5=AE=9A?= =?UTF-8?q?=E6=98=AF=E5=90=A6one=20tap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[lng]/page.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/[lng]/page.tsx b/app/[lng]/page.tsx index 8dc6640..90bed09 100644 --- a/app/[lng]/page.tsx +++ b/app/[lng]/page.tsx @@ -21,12 +21,12 @@ export default async function Index({ params: { lng } }: IndexProps) { const { t } = await useTranslation(lng); const cookieStore = cookies(); - + let supabase: any, user; const canInitSupabaseClient = () => { // This function is just for the interactive tutorial. // Feel free to remove it once you have Supabase connected. try { - createClient(cookieStore); + supabase = createClient(cookieStore); return true; } catch (e) { return false; @@ -34,7 +34,12 @@ export default async function Index({ params: { lng } }: IndexProps) { }; const isSupabaseConnected = canInitSupabaseClient(); - + if (supabase) { + ({ + data: { user }, + } = await supabase.auth.getUser()); + } + console.log("user in page", user); return (