diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/_store.js b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/_store.js index 2f5a904a..3b0b6ee4 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/_store.js +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/_store.js @@ -44,11 +44,12 @@ export default new Vuex.Store({ }).then((response) => { sessionStorage.setItem('token', response.data.token); commit('loginSuccess'); - }).catch((error) => { - commit('loginFailure'); - throw error; - }).then(() => { commit('loading', false); + return response.data.token; + }, (error) => { + commit('loginFailure'); + commit('loading', false); + throw error; }); }, logout({ commit }) { @@ -60,6 +61,7 @@ export default new Vuex.Store({ }).then(() => { sessionStorage.removeItem('token'); commit('logout'); + return true; }); }, loadCountries ({ commit }) { @@ -67,6 +69,7 @@ export default new Vuex.Store({ url: '/api/countries', }).then((response) => { commit('setCountries', response.data); + return response.data; }) } }, diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/Login.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/Login.vue index 652b9887..52eac893 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/Login.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/Login.vue @@ -46,8 +46,9 @@ this.$store.dispatch('login', { email: this.email, password: this.password - }).then(() => { + }).then((token) => { this.$router.push({ name: 'address' }); + return token; }).catch(() => { this.message = 'Der Login ist fehlgeschlagen :('; }).then(() => {