From 4cd0487bdcae52393583ec42a9938fecbc2e3d7f Mon Sep 17 00:00:00 2001 From: ClasWen Date: Sat, 24 Aug 2024 17:12:25 +0800 Subject: [PATCH] fix server side code --- src/components/NavigationUser.vue | 16 +++++++++++----- src/pages/callback.astro | 4 ++-- src/utils/auth.ts | 9 +++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/components/NavigationUser.vue b/src/components/NavigationUser.vue index c3f2e62..32853c0 100644 --- a/src/components/NavigationUser.vue +++ b/src/components/NavigationUser.vue @@ -1,29 +1,35 @@ diff --git a/src/pages/callback.astro b/src/pages/callback.astro index ae40e4e..4f85f8d 100644 --- a/src/pages/callback.astro +++ b/src/pages/callback.astro @@ -1,7 +1,7 @@
diff --git a/src/utils/auth.ts b/src/utils/auth.ts index f236c05..445db32 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,6 +1,7 @@ import LogtoClient from "@logto/browser" -export const logtoClient = new LogtoClient({ - endpoint: import.meta.env.PUBLIC_LOGTO_ENDPOINT, - appId: import.meta.env.PUBLIC_LOGTO_APP_ID, -}) +export const makeLogtoClient = () => + new LogtoClient({ + endpoint: import.meta.env.PUBLIC_LOGTO_ENDPOINT, + appId: import.meta.env.PUBLIC_LOGTO_APP_ID, + })