fix(ui): 403 clear the token (#2800)
This commit is contained in:
parent
1b564f53d5
commit
332cbb3516
1 changed files with 5 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue