1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00

Push a user into store when a session is created

This commit is contained in:
zinyando 2016-08-11 11:35:14 +02:00
parent 87f7631880
commit d47f1e11b8

View file

@ -22,6 +22,7 @@ const {
export default SimpleAuthSession.extend({
ajax: service(),
appMeta: service(),
store: service(),
isMac: false,
isMobile: false,
@ -37,10 +38,11 @@ export default SimpleAuthSession.extend({
user: computed('isAuthenticated', 'session.content.authenticated.user', function () {
if (this.get('isAuthenticated')) {
let user = this.get('session.content.authenticated.user') || { id: '' };
return models.UserModel.create(user);
let data = this.get('store').normalize('user', user);
return this.get('store').push({ data: data });
}
}),
folderPermissions: null,
currentFolder: null
});
});