Redirect when unauthenticated.

This commit is contained in:
James Cole
2023-04-10 14:21:10 +02:00
parent b91e019416
commit 9c4beab0a7

View File

@@ -72,6 +72,13 @@ export default defineComponent(
}).catch((err) => {
console.error('Could not load preferences.');
console.log(err);
// redirect user if 401
if (err.response) {
if(401 === err.response.status) {
window.location.href = '/login';
}
}
});
};