diff --git a/app/components/forms/reset-password-form.js b/app/components/forms/reset-password-form.js index 412dac04a83..1b0fbbf24ed 100644 --- a/app/components/forms/reset-password-form.js +++ b/app/components/forms/reset-password-form.js @@ -34,6 +34,19 @@ export default Component.extend(FormMixin, { { type : 'empty', prompt : this.l10n.t('Please enter your new password') + }, + { + type : 'minLength[8]', + prompt : this.l10n.t('Your password must have at least {ruleValue} characters') + } + ] + }, + repeatPassword: { + identifier : 'password_repeat', + rules : [ + { + type : 'match[password]', + prompt : this.l10n.t('Passwords do not match') } ] } @@ -42,6 +55,13 @@ export default Component.extend(FormMixin, { }, actions: { + showNewPassword() { + this.toggleProperty('showNewPass'); + }, + + showRepeatPassword() { + this.toggleProperty('showRepeatPass'); + }, submit() { this.onValid(() => { let payload = {}; diff --git a/app/templates/components/forms/reset-password-form.hbs b/app/templates/components/forms/reset-password-form.hbs index 933143cf938..e05ceeb10a4 100644 --- a/app/templates/components/forms/reset-password-form.hbs +++ b/app/templates/components/forms/reset-password-form.hbs @@ -20,7 +20,46 @@ {{#if token}}
- {{input type='password' name='password' placeholder=(t 'password') value=password}} + {{#if showNewPass}} + {{input type='text' name='password' placeholder=(t 'New Password') value=password}} + {{else}} + {{input type='password' name='password' placeholder=(t 'New Password') value=password}} + {{/if}} +
+ +
+
+ {{else}} +
+ + {{input name='email' placeholder=(t 'Email ID') value=identification}} +
+ {{/if}} + +
+ {{#if token}} +
+ + {{#if showRepeatPass}} + {{input type='text' name='password_repeat' placeholder=(t 'Confirm Password') value=password_repeat}} + {{else}} + {{input type='password' name='password_repeat' placeholder=(t 'Confirm Password') value=password_repeat}} + {{/if}} +
+ +
{{else}}
@@ -41,4 +80,4 @@
- + \ No newline at end of file