generator-ember-plus
Version:
Yeoman generator for Ember with added functionality
28 lines (23 loc) • 900 B
JavaScript
<%= _.classify(appname) %>.ApplicationRoute = Ember.Route.extend(Ember.SimpleAuth.ApplicationRouteMixin);
<%= _.classify(appname) %>.ApplicationRoute.reopen({
actions: {
authenticateSession: function() {
// Call the login method that shows the loginModal
this.send('login');
},
loginModalSubmit: function(username, password) {
// Username and password are bindings in the loginModal template
this.get('session').authenticate('authenticator:custom',
{
'username': this.controller.get('username'),
'password': this.controller.get('password')
});
},
login: function() {
Bootstrap.ModalManager.show('loginModal');
},
signup: function() {
Bootstrap.NM.push('Signup!', 'info');
}
}
});