From 97aca96e7e3c59a05464c6fd2c6b2d8ac8dbff66 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 2 Nov 2020 21:48:09 +0100 Subject: [PATCH] Fix logging out after reloading the page --- src/App.vue | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index cb15b53b9..898c1350b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -52,6 +52,7 @@ export default { }, beforeCreate() { this.$store.dispatch('config/update') + this.$store.dispatch('auth/checkAuth') }, created() { // Make sure to always load the home route when running with electron @@ -59,20 +60,12 @@ export default { this.$router.push({name: 'home'}) } }, - computed: { - authUser() { - return this.userAuthenticated && (this.userInfo && this.userInfo.type === authTypes.USER) - }, - authLinkShare() { - 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, - }), - }, + computed: mapState({ + authUser: state => state.auth.authenticated && (state.auth.info && state.auth.info.type === authTypes.USER), + authLinkShare: state => state.auth.authenticated && (state.auth.info && state.auth.info.type === authTypes.LINK_SHARE), + online: ONLINE, + keyboardShortcutsActive: KEYBOARD_SHORTCUTS_ACTIVE, + }), methods: { setupOnlineStatus() { this.$store.commit(ONLINE, navigator.onLine)