From 2d05aef24b36d1c8be5cdad13ae69a2f0514c713 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 26 Mar 2019 14:26:26 -0700 Subject: [PATCH] Add await to login action' --- src/boot/after_store.js | 2 +- src/lib/persisted_state.js | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index f5e84cbc67..f5add8ade5 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -241,7 +241,7 @@ const afterStoreSetup = async ({ store, i18n }) => { // Now we have the server settings and can try logging in if (store.state.oauth.token) { - store.dispatch('loginUser', store.state.oauth.token) + await store.dispatch('loginUser', store.state.oauth.token) } const router = new VueRouter({ diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js index 720ff706a3..7ab89c1235 100644 --- a/src/lib/persisted_state.js +++ b/src/lib/persisted_state.js @@ -60,9 +60,6 @@ export default function createPersistedState ({ merge({}, store.state, savedState) ) } - if (store.state.oauth.token) { - store.dispatch('loginUser', store.state.oauth.token) - } loaded = true } catch (e) { console.log("Couldn't load state")