Fix cookie paths

pull/157/head
Henrique Dias 2017-07-20 19:00:51 +01:00
parent 915eb68954
commit 2936858adb
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
5 changed files with 13 additions and 2392 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

File diff suppressed because one or more lines are too long