1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

Give missing account warning during password reset

The reset password process will tell the user if they do not have an account.
This commit is contained in:
Harvey Kandola 2019-04-09 13:24:27 +01:00
parent 2ddd7ada9b
commit b5a5cfd697
4 changed files with 24 additions and 6 deletions

View file

@ -18,6 +18,7 @@ import Component from '@ember/component';
export default Component.extend({
email: "",
sayThanks: false,
sayError: false,
emailEmpty: empty('email'),
hasEmptyEmailError: and('emailEmpty', 'emailIsEmpty'),
@ -30,10 +31,16 @@ export default Component.extend({
return $("#email").focus();
}
set(this, 'sayThanks', false);
set(this, 'sayError', false);
set(this, 'emailIsEmpty', false);
this.get('forgot')(email).then(() => {
set(this, 'sayThanks', true);
set(this, 'email', '');
set(this, 'emailIsEmpty', false);
}).catch(() => {
set(this, 'sayError', true);
});
}
}