Reload the page on status change

This commit is contained in:
Daniel_I_Am 2021-09-02 14:48:52 +02:00
parent c17c7b7a82
commit 912c9f63a7

View File

@ -20,7 +20,7 @@ export default {
}, },
data() { data() {
return { return {
status: false, status: undefined,
tokenId: null tokenId: null
}; };
}, },
@ -43,7 +43,12 @@ export default {
checkValidity() { checkValidity() {
axios.get('/api/auth') axios.get('/api/auth')
.then(res => { .then(res => {
const oldStatus = this.status;
this.status = res.data.status; this.status = res.data.status;
if (oldStatus !== undefined && oldStatus !== this.status) {
window.location.reload();
}
}); });
}, },
getCurrentToken() { getCurrentToken() {