mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
FEATURE: carry username or email from login form to the forgot password and signup forms
This commit is contained in:
parent
7209f67898
commit
def034cd08
2 changed files with 17 additions and 3 deletions
|
@ -2,7 +2,7 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
import DiscourseController from 'discourse/controllers/controller';
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default DiscourseController.extend(ModalFunctionality, {
|
||||||
needs: ['modal', 'createAccount', 'application'],
|
needs: ['modal', 'createAccount', 'forgotPassword', 'application'],
|
||||||
authenticate: null,
|
authenticate: null,
|
||||||
loggingIn: false,
|
loggingIn: false,
|
||||||
loggedIn: false,
|
loggedIn: false,
|
||||||
|
@ -122,8 +122,22 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
|
|
||||||
createAccount: function() {
|
createAccount: function() {
|
||||||
var createAccountController = this.get('controllers.createAccount');
|
var createAccountController = this.get('controllers.createAccount');
|
||||||
createAccountController.resetForm();
|
if (createAccountController) {
|
||||||
|
createAccountController.resetForm();
|
||||||
|
var loginName = this.get('loginName');
|
||||||
|
if (loginName && loginName.indexOf('@') > 0) {
|
||||||
|
createAccountController.set("accountEmail", loginName);
|
||||||
|
} else {
|
||||||
|
createAccountController.set("accountUsername", loginName);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.send('showCreateAccount');
|
this.send('showCreateAccount');
|
||||||
|
},
|
||||||
|
|
||||||
|
forgotPassword: function() {
|
||||||
|
var forgotPasswordController = this.get('controllers.forgotPassword');
|
||||||
|
if (forgotPasswordController) { forgotPasswordController.set("accountEmailOrUsername", this.get("loginName")); }
|
||||||
|
this.send("showForgotPassword");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
{{password-field value=loginPassword type="password" id="login-account-password" maxlength="200" capsLockOn=capsLockOn}}
|
{{password-field value=loginPassword type="password" id="login-account-password" maxlength="200" capsLockOn=capsLockOn}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="forgot-password-link" {{action "showForgotPassword"}}>{{i18n 'forgot_password.action'}}</a>
|
<a id="forgot-password-link" {{action "forgotPassword"}}>{{i18n 'forgot_password.action'}}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in a new issue