Browse Source

redirect to home page after any logout

bach 1 month ago
parent
commit
35e1ac5096

File diff suppressed because it is too large
+ 1 - 1
web/themes/custom/materiotheme/assets/dist/main.js


+ 19 - 4
web/themes/custom/materiotheme/vuejs/store/modules/user.js

@@ -5,8 +5,11 @@ import qs from 'querystring-es3'
 
 import materiauGQL from 'vuejs/api/gql/materiauflaglist.fragment.gql'
 
+// import router from 'vuejs/route' // this is not working
+
 export default {
   namespaced: true,
+  // router,
 
   // initial state
   state: {
@@ -78,12 +81,24 @@ export default {
       state.csrf_token = null
       state.isloggedin = false
       state.logout_token = null
-      if (state.isAdmin) {
-        // TODO: what if on a page where login is needed (as commerce checkout and cart)
-        window.location.reload(true)
-      }
       state.asAdmin = false
       state.canSearch = false
+      // if (state.isAdmin) {
+      //   // TODO: what if on a page where login is needed (as commerce checkout and cart)
+      //   window.location.reload(true)
+      // } else {
+      //
+      //   // return systematically to home page
+      //   this.$router.push({
+      //     name:`home`
+      //     // params: { alias:this.alias }
+      //     // query: { nid: this.item.nid }
+      //     // meta: { uuid:this.item.uuid },
+      //   })
+      // }
+
+      // redirect to home page in every case
+      window.location = window.location.origin 
     },
     setFlagColls (state, flagcolls) {
       console.log('User pre setFlagColls', state.flagcolls)