I'm trying to implement JWT authentication into my Ember application using the ember-simple-auth and ember-simple-auth-token modules by following their README files on GitHub. I got the authentication part to work pretty easily. I can send credentials to the authentication endpoint, and get a token back. But then when I try to implement authorization through the JSONAPIAdapter, I get the following error
Error: Failed to create an instance of 'authorizer:token'. Most likely an improperly defined class or an invalid module export.
I'm using Ember 2.12 and have the following setup:
app/adapters/application.js
export default DS.JSONAPIAdapter.extend(DataAdapterMixin, {
host: 'http://localhost:8000',
authorizer: 'authorizer:token'
});
app/routes/users.js
import Ember from 'ember';
export default Ember.Route.extend({
session: Ember.inject.service('session'),
model() {
return this.store.findAll('user');
}
});
package.json
"ember-cli-simple-auth": "^0.8.0",
"ember-simple-auth": "^1.2.2",
"ember-simple-auth-token": "^2.1.0",
Aucun commentaire:
Enregistrer un commentaire