Fix logging out after reloading the page
This commit is contained in:
parent
4140a54c4c
commit
97aca96e7e
1 changed files with 7 additions and 14 deletions
21
src/App.vue
21
src/App.vue
|
@ -52,6 +52,7 @@ export default {
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
this.$store.dispatch('config/update')
|
this.$store.dispatch('config/update')
|
||||||
|
this.$store.dispatch('auth/checkAuth')
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// Make sure to always load the home route when running with electron
|
// Make sure to always load the home route when running with electron
|
||||||
|
@ -59,20 +60,12 @@ export default {
|
||||||
this.$router.push({name: 'home'})
|
this.$router.push({name: 'home'})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: mapState({
|
||||||
authUser() {
|
authUser: state => state.auth.authenticated && (state.auth.info && state.auth.info.type === authTypes.USER),
|
||||||
return this.userAuthenticated && (this.userInfo && this.userInfo.type === authTypes.USER)
|
authLinkShare: state => state.auth.authenticated && (state.auth.info && state.auth.info.type === authTypes.LINK_SHARE),
|
||||||
},
|
online: ONLINE,
|
||||||
authLinkShare() {
|
keyboardShortcutsActive: KEYBOARD_SHORTCUTS_ACTIVE,
|
||||||
return this.userAuthenticated && (this.userInfo && this.userInfo.type === authTypes.LINK_SHARE)
|
}),
|
||||||
},
|
|
||||||
...mapState({
|
|
||||||
userInfo: state => state.auth.info,
|
|
||||||
userAuthenticated: state => state.auth.authenticated,
|
|
||||||
online: ONLINE,
|
|
||||||
keyboardShortcutsActive: KEYBOARD_SHORTCUTS_ACTIVE,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
setupOnlineStatus() {
|
setupOnlineStatus() {
|
||||||
this.$store.commit(ONLINE, navigator.onLine)
|
this.$store.commit(ONLINE, navigator.onLine)
|
||||||
|
|
Loading…
Reference in a new issue