mirror of
https://github.com/documize/community.git
synced 2025-07-23 15:19:42 +02:00
Push a user into store when a session is created
This commit is contained in:
parent
87f7631880
commit
d47f1e11b8
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue