handle logout
parent
5e186bf4f6
commit
5b62d4ff3f
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue