permission: read cookie from both default and /client path

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2020-02-19 12:52:36 +05:30
parent 89de51ee90
commit e03c332d56

View File

@ -34,7 +34,7 @@ router.beforeEach((to, from, next) => {
// start progress bar
NProgress.start()
to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))
const validLogin = Vue.ls.get(ACCESS_TOKEN) || Cookies.get('sessionkey') || Cookies.get('userid')
const validLogin = Vue.ls.get(ACCESS_TOKEN) || Cookies.get('userid') || Cookies.get('userid', { path: '/client' })
if (validLogin) {
if (to.path === '/user/login') {
next({ path: '/dashboard' })