0
0
Fork 0

Have catch blocks call the auth expire function

This commit is contained in:
Oliver-Akins 2020-08-17 23:19:35 -06:00
parent c9c1e57187
commit ae5a697de5
4 changed files with 18 additions and 14 deletions

View file

@ -103,7 +103,11 @@ export default {
};
this.data_populated = true;
})
.catch(err => console.error(err))
.catch(err => {
if (err.status == 401) {
this.auth_expired();
};
});
})
},
computed: {

View file

@ -136,10 +136,9 @@ export default {
this.populate_playlist()
})
.catch((err) => {
console.error(err)
window.location.hash = ``;
window.location.href = `${this.auth_redirect}?error=${encodeURI(err)}`;;
return
if (err.status == 401) {
this.auth_expired();
};
})
},
populate_playlist() {
@ -162,10 +161,9 @@ export default {
this.success = true;
})
.catch((err) => {
console.error(err)
window.location.hash = ``;
window.location.href = `${this.auth_redirect}?error=${encodeURI(err)}`;;
return;
if (err.status == 401) {
this.auth_expired();
};
})
},
},