From 2dddc2299f656a63273777af4ca7b429647ab832 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 25 Apr 2022 15:18:52 +0800 Subject: [PATCH] push crisp --- resources/assets/vue/app.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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