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',
data: formData,
method: 'post'
}).then(() => {
}).then((response) => {
commit('loadingFinish');
return response;
}).catch((error) => {
commit('loadingFinish');
throw error;
@@ -81,12 +81,19 @@
}
this.$store.dispatch('resetPassword',
this.email
).then(() => {
).then((response) => {
this.email = '';
this.$store.commit('alert', {
message: 'Du erhältst in Kürze eine E-Mail mit einem Link zum (Zurück)setzen deines Passworts.',
class: 'alert-success'
});
if (response.data.success) {
this.$store.commit('alert', {
message: 'Du erhältst in Kürze eine E-Mail mit einem Link zum (Zurück)setzen deines Passworts.',
class: 'alert-success'
});
} else {
this.$store.commit('alert', {
message: 'Diese E-Mail Adresse konnte nicht gefunden werden.',
class: 'alert-danger'
});
}
}).then(() => {
EventBus.$emit('scrollTo', '#myep-main');
});