From cadb2b456d2ccb5ddba8b20ec4b6ca64a7c6e6c5 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 2 Dec 2024 20:54:23 +0100 Subject: [PATCH] fix(ui): 403 clear the token --- frontend/app/api_client.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/app/api_client.ts b/frontend/app/api_client.ts index 431cea014..a8ac9b3b2 100644 --- a/frontend/app/api_client.ts +++ b/frontend/app/api_client.ts @@ -198,6 +198,11 @@ export default class APIClient { } return fetch(edp + _path, init).then((response) => { + if (response.status === 403) { + console.warn('API returned 403. Clearing JWT token.'); + this.onUpdateJwt({ jwt: undefined }); // Clear the token + } + if (response.ok) { return response; } else {