fix(ui): 403 clear the token (#2800)

This commit is contained in:
Shekar Siri 2024-12-02 20:55:05 +01:00 committed by GitHub
parent 1b564f53d5
commit 332cbb3516
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {