Fix bug when checking user session

must have a user before can be root
This commit is contained in:
Lance Edgar 2019-12-02 13:53:23 -06:00
parent 1b7c029a83
commit 7f1ef1b335

View file

@ -35,7 +35,7 @@ export default {
// let all of app know who the user is(n't)
this.$store.commit('SET_USER', response.data.user)
this.$store.commit('SET_USER_IS_ROOT', response.data.user.is_root)
this.$store.commit('SET_USER_IS_ROOT', response.data.user ? response.data.user.is_root : false)
// also keep track of user's permissions
this.$store.commit('SET_PERMISSIONS', response.data.permissions)