diff --git a/core/client/controllers/signin.js b/core/client/controllers/signin.js index 623f3933ef..de4fe8debf 100644 --- a/core/client/controllers/signin.js +++ b/core/client/controllers/signin.js @@ -1,5 +1,21 @@ -var SigninController = Ember.Controller.extend(Ember.SimpleAuth.LoginControllerMixin, { +import ValidationEngine from 'ghost/mixins/validation-engine'; + +var SigninController = Ember.Controller.extend(Ember.SimpleAuth.LoginControllerMixin, ValidationEngine, { authenticatorFactory: 'ember-simple-auth-authenticator:oauth2-password-grant', + + validationType: 'signin', + + actions: { + validateAndAuthenticate: function () { + var self = this; + + this.validate({ format: false }).then(function () { + self.send('authenticate'); + }).catch(function (errors) { + self.notifications.showErrors(errors); + }); + } + } }); export default SigninController; diff --git a/core/client/templates/signin.hbs b/core/client/templates/signin.hbs index b8bb3ccddd..caa4f6552f 100644 --- a/core/client/templates/signin.hbs +++ b/core/client/templates/signin.hbs @@ -1,12 +1,12 @@
-
+
{{input class="password" type="password" placeholder="Password" name="password" value=password}}
- +
{{#link-to 'forgotten' class="forgotten-password"}}Forgotten password?{{/link-to}}