Skip to content

Commit

Permalink
Merge pull request #2291 from PolicyEngine/2263_fix_header
Browse files Browse the repository at this point in the history
Use Authorization header instead of Authentication
  • Loading branch information
anth-volk authored Jan 3, 2025
2 parents fb42420 + 42bf56a commit 3595205
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/hooks/useAuthenticatedFetch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("useAuthenticatedFetch", () => {
...requestOptions,
headers: {
...requestOptions.headers,
Authentication: "Bearer TEST_AUTH_TOKEN",
Authorization: "Bearer TEST_AUTH_TOKEN",
},
},
]);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAuthenticatedFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function useAuthenticatedFetch() {
try {
//as per https://auth0.com/docs/quickstart/spa/react/02-calling-an-api
const accessToken = await getAccessTokenSilently();
headers["Authentication"] = `Bearer ${accessToken}`;
headers["Authorization"] = `Bearer ${accessToken}`;
} catch (error) {
//IGNORE. If we can't get an access token we just call the API
//without it.
Expand Down

0 comments on commit 3595205

Please sign in to comment.