From 8a7017eb1c98ca244dd97d09e41640fdbf5893a3 Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 Date: Fri, 22 Sep 2023 21:28:19 -0400 Subject: [PATCH] chore: Update client to use bearer token --- src/server/handlers/catch-all-handler.tsx | 2 +- src/shared/services/UserService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/handlers/catch-all-handler.tsx b/src/server/handlers/catch-all-handler.tsx index d872af14..cfbe95b1 100644 --- a/src/server/handlers/catch-all-handler.tsx +++ b/src/server/handlers/catch-all-handler.tsx @@ -37,7 +37,7 @@ export default async (req: Request, res: Response) => { : undefined; if (auth) { - client.setHeaders({ auth }); + client.setHeaders({ Authorization: `Bearer ${auth}` }); } const { path, url, query } = req; diff --git a/src/shared/services/UserService.ts b/src/shared/services/UserService.ts index 254ed8da..a82e6ea9 100644 --- a/src/shared/services/UserService.ts +++ b/src/shared/services/UserService.ts @@ -82,7 +82,7 @@ export class UserService { const { jwt } = cookie.parse(document.cookie); if (jwt) { - HttpService.client.setHeaders({ auth: jwt }); + HttpService.client.setHeaders({ Authorization: `Bearer ${jwt}` }); this.jwtInfo = { jwt, claims: jwt_decode(jwt) }; } }