From 1fe2e5afe30a8885c3fe801cf02482b3fbd1c42b Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 19 Apr 2024 18:16:19 +0200 Subject: [PATCH] fix(ui): include credentials for fetch request to address the refresh token issue (#2113) --- frontend/app/api_client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/app/api_client.ts b/frontend/app/api_client.ts index 42ddcd1d3..7ba2e3e39 100644 --- a/frontend/app/api_client.ts +++ b/frontend/app/api_client.ts @@ -154,6 +154,12 @@ export default class APIClient { edp = `${edp}/${this.siteId}`; } + if (path.includes('login') || path.includes('refresh') || path.includes('logout')) { + init.credentials = 'include'; + } else { + delete init.credentials; + } + return fetch(edp + path, init).then((response) => { if (response.ok) { return response;