diff --git a/app/assets/javascripts/discourse/app/controllers/forgot-password.js b/app/assets/javascripts/discourse/app/controllers/forgot-password.js index d2887d43a62..1471541673b 100644 --- a/app/assets/javascripts/discourse/app/controllers/forgot-password.js +++ b/app/assets/javascripts/discourse/app/controllers/forgot-password.js @@ -15,7 +15,15 @@ export default Controller.extend(ModalFunctionality, { @discourseComputed("accountEmailOrUsername", "disabled") submitDisabled(accountEmailOrUsername, disabled) { - return isEmpty((accountEmailOrUsername || "").trim()) || disabled; + if (disabled) { + return true; + } + + if (this.siteSettings.hide_email_address_taken) { + return (accountEmailOrUsername || "").indexOf("@") === -1; + } else { + return isEmpty((accountEmailOrUsername || "").trim()); + } }, onShow() { diff --git a/app/assets/javascripts/discourse/app/templates/modal/forgot-password.hbs b/app/assets/javascripts/discourse/app/templates/modal/forgot-password.hbs index 9e850979064..ccaa83d673e 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/forgot-password.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/forgot-password.hbs @@ -3,8 +3,13 @@ {{#if offerHelp}} {{html-safe offerHelp}} {{else}} - - {{text-field value=accountEmailOrUsername placeholderKey="login.email_placeholder" id="username-or-email" autocorrect="off" autocapitalize="off"}} + {{#if siteSettings.hide_email_address_taken}} + + {{text-field value=accountEmailOrUsername placeholderKey="email" id="username-or-email" autocorrect="off" autocapitalize="off"}} + {{else}} + + {{text-field value=accountEmailOrUsername placeholderKey="login.email_placeholder" id="username-or-email" autocorrect="off" autocapitalize="off"}} + {{/if}} {{/if}} {{/d-modal-body}}