Prevent attempt at getting profile data when in dev or preview mode
This commit is contained in:
parent
fe333b2b4d
commit
8913b377e6
1 changed files with 21 additions and 19 deletions
|
|
@ -168,15 +168,16 @@ export default {
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
|
if (!(this.preview || this.dev)) {
|
||||||
axios.get(
|
axios.get(
|
||||||
`${this.api_url}/me`,
|
`${this.api_url}/me`,
|
||||||
{ headers: { Authorization: `Bearer ${this.api_token}` } }
|
{ headers: { Authorization: `Bearer ${this.api_token}` } }
|
||||||
).then((response) => {
|
).then((response) => {
|
||||||
if (response.error) {
|
if (response.error && !(this.preview || this.dev)) {
|
||||||
window.location.hash = ``;
|
window.location.hash = ``;
|
||||||
window.location.href = `${this.auth_redirect}?error=${encodeURI(response.error)}`;
|
window.location.href = `${this.auth_redirect}?error=${encodeURI(response.error)}`;
|
||||||
return
|
return;
|
||||||
}
|
};
|
||||||
let data = response.data;
|
let data = response.data;
|
||||||
|
|
||||||
// Set the Vue user object
|
// Set the Vue user object
|
||||||
|
|
@ -189,6 +190,7 @@ export default {
|
||||||
window.location.href = `${this.auth_redirect}?error=${encodeURI(err)}`;;
|
window.location.href = `${this.auth_redirect}?error=${encodeURI(err)}`;;
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue