Created
October 17, 2014 20:16
-
-
Save colinhoernig/82c311b4029d8e5ab193 to your computer and use it in GitHub Desktop.
Custom session initializer for Ember Simple Auth...not currently working
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import Session from 'simple-auth/session'; | |
var SessionWithUser = Session.extend({ | |
user: function () { | |
var userId = this.get('user_id'); | |
if (!Ember.isEmpty(userId)) { | |
return this.container.lookup('store:main').find('user', userId); | |
} | |
}.property('user_id') | |
}); | |
export default { | |
name: 'customize-session', | |
before: 'simple-auth', | |
initialize: function(container){ | |
container.register('session:custom', SessionWithUser); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment