Fix typo and store apiurl

This commit is contained in:
Matthias 2020-06-20 19:19:30 +02:00
parent 82f99d7abb
commit 835cc658f1
2 changed files with 5 additions and 2 deletions

View File

@ -32,6 +32,7 @@ export default {
console.log('Starting automatic refresh.');
this.refreshFrequent();
this.refreshInterval = setInterval(() => {
console.log('refreshing_interval');
this.refreshFrequent();
}, 5000);
this.refreshSlow();
@ -41,7 +42,7 @@ export default {
},
stopRefresh() {
console.log('Stopping automatic refresh.');
clearInterval(this.refreshinterval);
clearInterval(this.refreshInterval);
clearInterval(this.refreshIntervalSlow);
},
},

View File

@ -37,7 +37,7 @@ export default {
)
.then((result) => {
console.log(result.data);
this.setAPIUrl(auth.url);
if (result.data.access_token) {
this.setAccessToken(result.data.access_token);
}
@ -51,6 +51,8 @@ export default {
refreshToken() {
console.log('Refreshing token...');
const token = JSON.parse(localStorage.getItem(AUTH_REF_TOKEN) || '{}');
const apiurl = this.getAPIUrl();
console.log(apiurl);
axios
.post(
`${this.getAPIUrl()}/token/refresh`,