Here's what I did in the end:
app/sessions/custom.js
import Ember from 'ember';
import DS from 'ember-data';
import Session from 'simple-auth/session';
export default Session.extend({
currentUser: function() {
var userId = this.get('secure.userId');
if (!Ember.isEmpty(userId)) {
return DS.PromiseObject.create({
promise: this.container.lookup('store:main').find('user', userId)
});
}
}.property('secure.userId'),
// Update the session email when the user successfully changes their email.
updateEmail: Ember.observer('currentUser.email', function() {
var currentUserEmail = this.get('currentUser.email'),
sessionEmail = this.get('secure.email');
if(currentUserEmail && !this.get('currentUser.isDirty') && sessionEmail !== currentUserEmail) {
this.set('secure.email', currentUserEmail);
this.set('email', currentUserEmail);
}
}),
});
It seems that updateStore on the session doesn't get called when you set 'secure.email' but it does get called when you set 'email', however, just setting 'email' is not sufficient because updateStore uses 'secure.email' to persist the data (email & token).