Skip to content

Instantly share code, notes, and snippets.

@bmax
Created August 9, 2014 00:06
Show Gist options
  • Save bmax/9edf4d2ba4bf62343a82 to your computer and use it in GitHub Desktop.
Save bmax/9edf4d2ba4bf62343a82 to your computer and use it in GitHub Desktop.
app/index.html
---
app/initiliazers/application.js
---
import Ember from 'ember';
import Base from 'simple-auth/authenticators/base';
var CustomAuthenticator = Base.extend({
authenticate: function() {
console.log("YYOO");
}
});
export default {
name: 'authentication',
after: 'simple-auth',
initialize: function(container, application) {
var applicationRoute = container.lookup('route:application');
var session = container.lookup('simple-auth-session:main');
// handle the session events
session.on('sessionAuthenticationSucceeded', function() {
applicationRoute.transitionTo('index');
});
}
};
app/initilizers/simple-auth.js
---
import initializer from 'simple-auth/initializer';
export default initializer;
app/controllers/login.js
---
import Ember from 'ember';
import AuthenticationControllerMixin from 'simple-auth/mixins/authentication-controller-mixin';
export default Ember.Controller.extend(AuthenticationControllerMixin, {
authenticator: 'authenticator:custom'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment