0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Merge pull request #3408 from jaswilli/issue-3399

Do not clear password until after leaving signin
This commit is contained in:
Hannah Wolfe 2014-07-27 19:30:37 +01:00
commit c34b8fc6ff
2 changed files with 18 additions and 2 deletions

View file

@ -1,11 +1,17 @@
import ValidationEngine from 'ghost/mixins/validation-engine';
var SigninController = Ember.Controller.extend(SimpleAuth.LoginControllerMixin, ValidationEngine, {
var SigninController = Ember.Controller.extend(SimpleAuth.AuthenticationControllerMixin, ValidationEngine, {
authenticator: 'simple-auth-authenticator:oauth2-password-grant',
validationType: 'signin',
actions: {
authenticate: function () {
var data = this.getProperties('identification', 'password');
return this._super(data);
},
validateAndAuthenticate: function () {
var self = this;

View file

@ -8,6 +8,16 @@ var SigninRoute = Ember.Route.extend(styleBody, loadingIndicator, {
this.transitionTo(SimpleAuth.Configuration.routeAfterAuthentication);
}
},
// the deactivate hook is called after a route has been exited.
deactivate: function () {
this._super();
// clear the password property from the controller when we're no longer
// on the signin screen
this.controllerFor('signin').set('password', '');
},
actions: {
sessionAuthenticationFailed: function (error) {
this.notifications.closePassive();
@ -39,4 +49,4 @@ var SigninRoute = Ember.Route.extend(styleBody, loadingIndicator, {
});
export default SigninRoute;
export default SigninRoute;