I have an EmberJS application built using ember-cli. I am currently using simple-auth with a user authenticator.
In the authenticator, when the user logs in, I want to save his data in order to use it later. I have the following code:
authenticate: function(options) {
var self = this;
return new Ember.RSVP.Promise(function(resolve, reject){
API.user.login(options.username, options.password, true).done(function(data) {
resolve(data.id);
}).fail(function() {
reject();
});
});
},
User data is available in the variable data.user.
I tried to use Ember.set('App.currentUser', data.user);, but it does not work. What should I do?
source
share