diff --git a/resources/assets/vue/app.js b/resources/assets/vue/app.js index ec252067..cddcf3a7 100644 --- a/resources/assets/vue/app.js +++ b/resources/assets/vue/app.js @@ -50,19 +50,19 @@ const app = new Vue({ store, created(){ this.routesGuard(); - // if (!('company_marking' in this.$store.getters.getDecodedAccessToken.user) && this.isProtectedRoute()) { - // this.$store.dispatch('crudRequest', {endpoint: this.route('api.account.authentication.refresh'), method: 'get'}).then(response => { - // let success = response.ok; - // response.json().then(response => { - // - // if(!success){return;} - // - // this.$store.dispatch('userAuthentication', {access_token: response.payload.refresh_token, redirect_url: window.location.href}); - // - // }); - // }) - // - // } + if (!this.$store.getters.isAdmin && !('company_marking' in this.$store.getters.getDecodedAccessToken.user) && this.isProtectedRoute()) { + this.$store.dispatch('crudRequest', {endpoint: this.route('api.account.authentication.refresh'), method: 'get'}).then(response => { + let success = response.ok; + response.json().then(response => { + + if(!success){return;} + + this.$store.dispatch('userAuthentication', {access_token: response.payload.refresh_token, redirect_url: window.location.href}); + + }); + }) + + } }, methods: { route: route