From 394b5ea404d9ae008de7bc8ef524c0c235f5b65a Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 19 Apr 2024 18:13:27 +0200 Subject: [PATCH] fix(ui): include credentials for fetch request to address the refresh token issue --- 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 1feda4dfd..ed739c8f8 100644 --- a/frontend/app/api_client.ts +++ b/frontend/app/api_client.ts @@ -160,6 +160,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;