I have the following code:
changeUsername: function(){
var _this = this;
this.store.findById('user', this.session.get('user.id')).then(function(user){
user.set('username', _this.get('newUsername'));
user.save();
_this.session.set('user.username', _this.get('newUsername'));
_this.session.persist();
});
}
As you can see - I am persisting to the ember simple auth session a user object which I want to update in this method.
Calling persist on the session doesn't do the trick.
I have also tried:
_this.session.store.set('user.username', _this.get('newUsername'));
_this.session.store.save();
Which didn't work either.
How can I update the user object on the session?