Skip to content

Commit

Permalink
fix: attempt to fix data loading due auth issue (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
truc9 committed Nov 27, 2024
1 parent 3150fb0 commit 8dd3235
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/common/httpservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ const client = axios.create({

async function getAuthHeaders() {
try {
const token = await auth0.getTokenSilently();
const token = await auth0.getTokenSilently({
authorizationParams: {
scope: "read:current_user",
audience: import.meta.env.VITE_AUTH0_AUDIENCE
}
});
return {
Authorization: `Bearer ${token}`
};
} catch (e) {
alert('Unable to get access token!!!');
alert(`Unable to get access token: ${e}`);
return {};
}
}
Expand Down

0 comments on commit 8dd3235

Please sign in to comment.