做Ember.SimpleAuth.setup使用燼,簡單AUTH使用燼-CLI-簡單AUTH我有這個初始化之前:如何通過AMD
Ember.Application.initializer({
name: 'authentication',
initialize: function(container, application) {
container.register('authenticator:api', Oauth2Authenticator);
Ember.SimpleAuth.setup(container, application, {
authorizerFactory: 'ember-simple-auth-authorizer:oauth2-bearer',
routeAfterAuthentication: 'dashboard',
routeAfterInvalidation: 'login',
storeFactory: 'ember-simple-auth-session-store:local-storage'
});
}
});
如何做到這一點,現在,使用進口的時候,我設法解決了這個問題:
import Oauth2Authenticator from '../services/authenticator';
export default {
name: 'authentication',
initialize: function(container, app) {
container.register('authenticator:api', Oauth2Authenticator);
// THIS PART IS NOT CLEAR, HOW TO SETUP IN AMD?
Ember.SimpleAuth.setup(container, application, {
authorizerFactory: 'ember-simple-auth-authorizer:oauth2-bearer',
routeAfterAuthentication: 'dashboard',
routeAfterInvalidation: 'login',
storeFactory: 'ember-simple-auth-session-store:local-storage'
});
// END OF CONFUSING PART
}
};
謝謝!