FIX: Forgot Password route was broken

This commit is contained in:
Robin Ward 2016-12-30 12:47:04 -05:00
parent da76dd3d6b
commit 32301f4620
2 changed files with 10 additions and 8 deletions

View File

@ -1,10 +1,12 @@
import { defaultHomepage } from 'discourse/lib/utilities';
import buildStaticRoute from 'discourse/routes/build-static-route';
const ForgotPasswordRoute = buildStaticRoute('password-reset');
ForgotPasswordRoute.reopen({
beforeModel() {
this.replaceWith(this.controllerFor('application').get('loginRequired') ? 'login' : 'discovery').then(e => {
const loginRequired = this.controllerFor('application').get('loginRequired');
this.replaceWith(loginRequired ? 'login' : `discovery.${defaultHomepage()}`).then(e => {
Ember.run.next(() => e.send('showForgotPassword'));
});
},

View File

@ -1,9 +1,9 @@
<form>
<div class="modal-body">
<label for='username-or-email'>{{i18n 'forgot_password.invite'}}</label>
{{text-field value=accountEmailOrUsername placeholderKey="login.email_placeholder" id="username-or-email" autocorrect="off" autocapitalize="off"}}
</div>
<div class="modal-footer">
<button class='btn btn-large btn-primary' disabled={{submitDisabled}} {{action "submit"}}>{{i18n 'forgot_password.reset'}}</button>
</div>
{{#d-modal-body}}
<label for='username-or-email'>{{i18n 'forgot_password.invite'}}</label>
{{text-field value=accountEmailOrUsername placeholderKey="login.email_placeholder" id="username-or-email" autocorrect="off" autocapitalize="off"}}
{{/d-modal-body}}
<div class="modal-footer">
<button class='btn btn-large btn-primary' disabled={{submitDisabled}} {{action "submit"}}>{{i18n 'forgot_password.reset'}}</button>
</div>
</form>