getoutreach / epf

A framework for keeping your Ember.js apps in sync.
http://epf.io
MIT License
369 stars 33 forks source link

Epf conflict with Ember.SimpleAuth #127

Closed ncoquelet closed 10 years ago

ncoquelet commented 10 years ago

Hi, I use Epf and Ember.SimpleAuth library on my project.

You too register a "session:main" object in the container et inject a "session" object into the routes ! This do a conflict !

This is a big issue for me and all others who want use your respectively amazing libraries.

Do you have a work around for this ??

Thanks

ghempton commented 10 years ago

Interesting. I don't use Ember.SimpleAuth, but what exactly is happening? Is the second library smashing the injection of the first?

Eventually Ember.js might support namespaces on the container, but in the short term one fix might be to manually re-inject things under a different type/name.

The EPF injections are kind of complex and there are a lot of inter-dependencies– it might be easier to do this on Ember.SimpleAuth's end:

container.register('auth-session:main', container.lookupFactory('auth-session:application'));

For references, here is the container setup for epf: https://github.com/getoutreach/epf/blob/master/lib/setup_container.js#L15

recipher commented 10 years ago

Might be simplest to fork ember-simple-auth. I think the container injections are a little tricky to override.

On 30 April 2014 19:02, Gordon L. Hempton notifications@github.com wrote:

Interesting. I don't use Ember.SimpleAuth, but what exactly is happening. Is the second library smashing the inject of the first?

Eventually Ember.js might support namespaces on the container, but in the short term one fix might be to manually re-inject things under a different type/name.

The EPF injections are kind of complex and there are a lot of inter-dependencies– it might be easier to do this on Ember.SimpleAuth's end:

container.register('auth-session:main', container.lookupFactory('auth-session:application'));

For references, here is the container setup for epf: https://github.com/getoutreach/epf/blob/master/lib/setup_container.js#L15

— Reply to this email directly or view it on GitHubhttps://github.com/getoutreach/epf/issues/127#issuecomment-41828461 .

ncoquelet commented 10 years ago

Hi, Thanks for your responses.

In my case, simple-auth is import before epf and the session injected in the route is the auth session.

Yesterday, i'm adapt ember-simple-auth and it's pretty easy. Rename the session stored in the container and rename the session field injected into controllers ans routes. About 5/6 lines changed.

I will fork ember-simple-auth and put changes into github for other peoples in my case.

Thanks

recipher commented 10 years ago

Good show.

Might be worth speaking to the simpleauth maintainer, to see if there is a way to override the container naming, or to provide a configuration point. Should really be namespaced some way, but until that is possible.

On 1 May 2014 12:31, ncoquelet notifications@github.com wrote:

Hi, Thanks for your responses.

In my case, simple-auth is import before epf and the session injected in the route is the auth session.

Yesterday, i'm adapt ember-simple-auth and it's pretty easy. Rename the session stored in the container and rename the session field injected into controllers ans routes. About 5/6 lines changed.

I will fork ember-simple-auth and put changes into github for other peoples in my case.

Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/getoutreach/epf/issues/127#issuecomment-41901247 .

ncoquelet commented 10 years ago

Ember-simple-auth community has same idea. https://github.com/simplabs/ember-simple-auth/issues/159

my fork can be found here, https://github.com/ncoquelet/ember-simple-auth

marcoow commented 10 years ago

Ember.SimpleAuth now "namespaces" (actually prefixes as there is no namespacing in Ember's container) it's registered components (https://github.com/simplabs/ember-simple-auth/commit/326ed9ed8d4a31f76f0b2e04a2cd22658d4b5c48) and allows to configure the property names for injections (https://github.com/simplabs/ember-simple-auth/commit/f2d94a8480aac4d5be5a82ada7dfcefd058e13e3) - maybe that's sth. you'd consider for EPF as well.