Show message in case email is not registered

This commit is contained in:
Björn Fromme
2018-11-12 13:15:17 +01:00
parent 2fa5fc2a79
commit 66f9f9c1f0
2 changed files with 14 additions and 6 deletions
@@ -124,8 +124,9 @@ export default new Vuex.Store({
url: '/api/reset-password', url: '/api/reset-password',
data: formData, data: formData,
method: 'post' method: 'post'
}).then(() => { }).then((response) => {
commit('loadingFinish'); commit('loadingFinish');
return response;
}).catch((error) => { }).catch((error) => {
commit('loadingFinish'); commit('loadingFinish');
throw error; throw error;
@@ -81,12 +81,19 @@
} }
this.$store.dispatch('resetPassword', this.$store.dispatch('resetPassword',
this.email this.email
).then(() => { ).then((response) => {
this.email = ''; this.email = '';
if (response.data.success) {
this.$store.commit('alert', { this.$store.commit('alert', {
message: 'Du erhältst in Kürze eine E-Mail mit einem Link zum (Zurück)setzen deines Passworts.', message: 'Du erhältst in Kürze eine E-Mail mit einem Link zum (Zurück)setzen deines Passworts.',
class: 'alert-success' class: 'alert-success'
}); });
} else {
this.$store.commit('alert', {
message: 'Diese E-Mail Adresse konnte nicht gefunden werden.',
class: 'alert-danger'
});
}
}).then(() => { }).then(() => {
EventBus.$emit('scrollTo', '#myep-main'); EventBus.$emit('scrollTo', '#myep-main');
}); });