From d4063d5f8c0b9bdd669b5bee470783d0575ff415 Mon Sep 17 00:00:00 2001 From: Truc Nguyen Date: Wed, 27 Nov 2024 21:04:46 +0000 Subject: [PATCH] fix: attempt to fix auth issue (#14) --- frontend/src/common/httpservice.ts | 9 ++------ frontend/src/main.tsx | 36 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/frontend/src/common/httpservice.ts b/frontend/src/common/httpservice.ts index 8204944..4bb3de3 100644 --- a/frontend/src/common/httpservice.ts +++ b/frontend/src/common/httpservice.ts @@ -17,17 +17,12 @@ const client = axios.create({ async function getAuthHeaders() { try { - const token = await auth0.getTokenSilently({ - authorizationParams: { - scope: "read:current_user", - audience: import.meta.env.VITE_AUTH0_AUDIENCE - } - }); + const token = await auth0.getTokenSilently(); return { Authorization: `Bearer ${token}` }; } catch (e) { - alert(`Unable to get access token: ${e}`); + alert(e); return {}; } } diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 00ebbfc..39fa280 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -41,25 +41,25 @@ const theme = createTheme({ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - - - - - + + + + + - - - - - + + + + + , );