redirect to home page after any logout

This commit is contained in:
Bachir Soussi Chiadmi 2021-01-19 12:18:28 +01:00
parent 2cf2f378ce
commit 35e1ac5096
2 changed files with 20 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -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)