I created an ember simple auth authenticator addon and I'm attempting to register it in the initializer of the addon. However, when I install the addon the initializer never runs and the authenticator is not found.
In my addon, I ran the ember g initializer authentication command which added the initializer to the app/ directory. Inside, I added the following.
import MyAuthenticator from 'my-simple-auth/authenticators/my-oauth';
export default {
name: 'authentication',
before: 'simple-auth',
initialize: function(container, application) {
console.log("my.initializer"); // does not output to console
container.register('authenticator:my-auth', MyAuthenticator);
}
};
When I attempt to authenticate in my route, I get an error message stating that is has not be initialized. Other than removing my bower.js file and creating the authenticator, I left everything else as is.
Are there some specific steps I need to take in order to create an initializer in an ember addon, or do I need to create the initializer in each of my apps?
Aucun commentaire:
Enregistrer un commentaire