handle logout

master
alex 2024-02-11 19:27:18 +01:00
parent 5e186bf4f6
commit 5b62d4ff3f
1 changed files with 8 additions and 1 deletions

View File

@ -258,7 +258,14 @@ export function myFetch({
})
.catch((error) => {
// ignore errors here as they are handled in the components
if (error === 400 || error === 401) throw error;
if (error === 400) throw error;
if (error === 401) {
handleLogout({
setUserSession: setUserSessionToLocalStorage,
});
return;
}
// show error notification for all other errors