Reputation: 239
I am new to Ember and I'd like to use ember simple-auth library along with ember simple-auth-token. My problem is that I can't understand what to put in the authenticator variable. The code below is taken from the simple-auth-token readme on github.
// app/controllers/login.js
import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service(),
actions: {
authenticate: function() {
var credentials = this.getProperties('identification', 'password'),
authenticator = 'authenticator:token';
this.get('session').authenticate(authenticator, credentials);
}
}
});
My server responds with a token that looks pretty much like this: {"auth_token":"f4f49eed1ddc43254c8a"}.
Should I change 'authenticator:token' to 'authenticator:auth_token'? How exactly will the token value be passed to the authenticator?
Thanks in advance for your help!
Upvotes: 1
Views: 204
Reputation: 5955
The authenticator refers to which type of authenticator (token or JWT) should be used.
If you aren't using JWT tokens, then this issue is relevant to you: https://github.com/jpadilla/ember-simple-auth-token/issues/151
Upvotes: 1