Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/App.vue
Show All 26 Lines | export default { | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
const token = localStorage.getItem('token') | const token = localStorage.getItem('token') | ||||
if (token) { | if (token) { | ||||
this.$root.startLoading() | this.$root.startLoading() | ||||
axios.defaults.headers.common.Authorization = 'Bearer ' + token | axios.defaults.headers.common.Authorization = 'Bearer ' + token | ||||
axios.get('/api/auth/info?refresh_token=1') | axios.post('/api/auth/info?refresh=1', {refresh_token: localStorage.getItem("refreshToken")}) | ||||
.then(response => { | .then(response => { | ||||
this.$root.loginUser(response.data, false) | this.$root.loginUser(response.data, false) | ||||
this.$root.stopLoading() | this.$root.stopLoading() | ||||
this.isLoading = false | this.isLoading = false | ||||
}) | }) | ||||
.catch(error => { | .catch(error => { | ||||
// Release lock on the router-view, otherwise links (e.g. Logout) will not work | // Release lock on the router-view, otherwise links (e.g. Logout) will not work | ||||
this.isLoading = false | this.isLoading = false | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |