This commit is contained in:
romankko2 committed 2023-01-20 11:21:50 +01:00
commit 33dfb2bd6f
13 files changed
+80 -61

No files matched your search

+3 -1
View File
@@ -18,6 +18,8 @@ export default {
state.user = data.user
localStorage.setItem('wzo_vue_user_user', JSON.stringify(data.user))
}
console.log(state)
},
auth_error(state: any) {
state.token = ''
@@ -158,7 +160,7 @@ export default {
return state.user
},
token: (state: any) => {
return state.token
return (state.token && state.token != undefined) ? state.token : null
}
}
}
+4
View File
@@ -149,6 +149,10 @@ export default {
_config(config: any) {
if (config) console.error('NOT IMPLEMENTED')
if (!store.getters['auth/token']) {
return {headers: {}}
}
return {
headers: {
Authorization: `Bearer ${store.getters['auth/token']}`