Redirect when unauthenticated.

This commit is contained in:
James Cole 2023-04-10 14:21:10 +02:00
parent b91e019416
commit 9c4beab0a7
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

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