FIX: Forgot Password route was broken
This commit is contained in:
parent
da76dd3d6b
commit
32301f4620
|
@ -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'));
|
||||
});
|
||||
},
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue