Last active
October 4, 2015 17:52
-
-
Save Keeo/8c688f5e131b32cdb6c0 to your computer and use it in GitHub Desktop.
This file contains 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
//app/sessions/application | |
import Session from 'simple-auth/session'; | |
import Ember from 'ember'; | |
const { computed } = Ember; | |
const { service } = Ember.inject; | |
export default Session.extend({ | |
store: service(), | |
user: computed('secure.userId', function(){ | |
return this.get('store').findRecord('user', this.get('secure.userId')); | |
}) | |
}); | |
//config/environment.js | |
'simple-auth': { | |
session: 'session:application' | |
} |
@NullVoxPopuli do you use ember-cli? There is clean example if not - https://github.com/simplabs/ember-simple-auth/blob/master/examples/4-authenticated-account.html
I do use ember-cli.
here are my versions of things:
"ember": "1.13.10",
"ember-cli": "1.13.8",
"ember-simple-auth": "0.8.0",
"ember-data": "1.13",
if this is an ember 2 thing, I can finish up getting rid of my deprecation warnings and upgrade
Its not, it should work with 1.13.x.
I am wondering if problem is with store: service(),
or with session itself.
If error persists when you comment out this then there must be wrong something like file name, or configuration. Also check that your session is in app/sessions/application.js
//config/environment.js
module.exports = function (environment) {
var ENV = {
'simple-auth': {
session: 'session:application',
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this gave me an error:
Uncaught Error: Attempting to inject an unknown injection:
service:store
on this line:
in simple-auth.amd.js