Explorar o código

see also #119

ali %!s(int64=3) %!d(string=hai) anos
pai
achega
d22883acb2
Modificáronse 2 ficheiros con 4 adicións e 6 borrados
  1. 4 1
      src/boot/axios.js
  2. 0 5
      src/components/Auth/LoginStep.vue

+ 4 - 1
src/boot/axios.js

@@ -87,13 +87,16 @@ const AxiosHooks = (function () {
   }
 
   function deAuthorizeUser(router, store) {
+    // console.error('deAuthorizeUser')
     store.dispatch('Auth/logOut', { redirectTo: false, clearRedirectTo: false })
     const loginRouteName = 'Login'
     const currentRoute = (router?.currentRoute?._value) ? router.currentRoute._value : (router?.history?.current) ? router.history.current : null
     if (currentRoute && currentRoute.name === loginRouteName) {
       return
     }
-    store.commit('Auth/updateRedirectTo', currentRoute)
+    store.commit('Auth/updateRedirectTo', JSON.parse(JSON.stringify({ name: currentRoute.name, params: currentRoute.params, query: currentRoute.query })))
+    // console.error('router', router)
+    // console.error('loginRouteName', loginRouteName)
     router.push({ name: loginRouteName })
   }
 

+ 0 - 5
src/components/Auth/LoginStep.vue

@@ -78,11 +78,6 @@ export default {
     password: null,
     otp: null
   }),
-  computed: {
-    user () {
-      return this.$store.getters['Auth/user']
-    }
-  },
   created () {
     // if (this.getToken()) {
     //   this.getUserData(() => { this.redirectTo() })