Fix cookie paths

Former-commit-id: 25141b4324b7355bd9e1c5a04a8e51d7e6a293ed [formerly 350423a47322359a33c8db7743aa88b25f9c44e1] [formerly 8a7042ed9763a6b9c8ba1cf88c027aed6b663f08 [formerly 2936858adb]]
Former-commit-id: 8cf7d99da15f44c3572366bdae279e78c0bfd2c7 [formerly e35c21fe57fd3e6f2342248f1d228ae454a6285d]
Former-commit-id: 60db7620422cd88fa960388d2002ff82b36efe9c
This commit is contained in:
Henrique Dias 2017-07-20 19:00:51 +01:00
parent 2ff9622747
commit ee88bede6d
5 changed files with 13 additions and 75 deletions

View File

@ -214,8 +214,10 @@ export default {
}
}
document.cookie = `sort=${sort}; max-age=31536000; path=${this.$store.state.baseURL}`
document.cookie = `order=${order}; max-age=31536000; path=${this.$store.state.baseURL}`
let path = this.$store.state.baseURL
if (path === '') path = '/'
document.cookie = `sort=${sort}; max-age=31536000; path=${path}`
document.cookie = `order=${order}; max-age=31536000; path=${path}`
this.$store.commit('setReload', true)
}
}

View File

@ -20,7 +20,9 @@ export default {
}
this.$store.commit('listingDisplay', display)
document.cookie = `display=${display}; max-age=31536000; path=${this.$store.state.baseURL}`
let path = this.$store.state.baseURL
if (path === '') path = '/'
document.cookie = `display=${display}; max-age=31536000; path=${path}`
},
icon: function () {
if (this.$store.state.req.display === 'mosaic') return 'view_list'

View File

@ -3,7 +3,9 @@ import store from '@/store'
import router from '@/router'
function parseToken (token) {
document.cookie = `auth=${token}; max-age=86400; path=${store.state.baseURL}`
let path = store.state.baseURL
if (path === '') path = '/'
document.cookie = `auth=${token}; max-age=86400; path=${path}`
let res = token.split('.')
let user = JSON.parse(window.atob(res[1]))
store.commit('setJWT', token)
@ -49,7 +51,9 @@ function login (user, password) {
}
function logout () {
document.cookie = `auth='nothing'; max-age=0; path=${store.state.baseURL}`
let path = store.state.baseURL
if (path === '') path = '/'
document.cookie = `auth='nothing'; max-age=0; path=${path}`
router.push({path: '/login'})
}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
fa88fd833121555103e43bd245f906acd4de2dee