Created
August 9, 2014 00:06
-
-
Save bmax/9edf4d2ba4bf62343a82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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