From 5b7c32ebec6fd7a80f9d5366c2ef156003ae9244 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Tue, 24 Jan 2023 16:48:34 +0900 Subject: [PATCH] Updating axios to always send credentials --- website/src/lib/api.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/src/lib/api.ts b/website/src/lib/api.ts index df4bd399..f7a29f49 100644 --- a/website/src/lib/api.ts +++ b/website/src/lib/api.ts @@ -6,8 +6,11 @@ const headers = { "Content-Type": "application/json", }; +// Create Axios such that we always send credential cookies along with the +// request. This allows the Backend services to authenticate the user. const api = axios.create({ headers, + withCredentials: true, }); export const get = (url: string) => api.get(url).then((res) => res.data);