Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember.SimpleAuth conflict with Ember.PersistenceFoundation on "session" injection #159

Closed
ncoquelet opened this issue Apr 30, 2014 · 8 comments
Assignees

Comments

@ncoquelet
Copy link

Hi,

I start using Ember.SimpleAuth and it's an amazing library ! Well documented and very extensible.

On my projet, I also use Ember persistence foundation (EPF), but I am very bad problem.

Each use an injected object call "session" into the route ...

Do you have a idea to rename session object in SimpleAuth ?

Thanks

@marcoow
Copy link
Member

marcoow commented May 2, 2014

Not sure whether Ember has a strategy for conflicting injections. Right now the only solution would be to fork one of the 2 libraries and rename the injected property in the entire codebases. Maybe you can get in contact with the core team and find out whether there's something planned to solve that or some suggested strategy for 3rd party injections in general?

@bakura10
Copy link
Contributor

bakura10 commented May 4, 2014

Hi,

As Ember-Simple auth is much smaller than EPF, maybe we could rename "session" to "auth-session". this would make it much easier also for other users (I've always found it confusing to have a name "session"). What do you think?

@marcoow
Copy link
Member

marcoow commented May 5, 2014

Why do you find the name "session" to be confusing? Because that's what Ember.SimpleAuth's session actually is (by being a replacement for a server side session which doesn't exist in Ember apps). I don't think renaming is not really a good idea - I'd rather come up with a short guide on how to rename it manually if there's a conflict (resolving the conflict with EPF doesn't mean the next conflict couldn't come up soon thereafter).

@marcoow marcoow self-assigned this May 5, 2014
@bakura10
Copy link
Contributor

bakura10 commented May 5, 2014

The fact that it's using a common English name ("session") will without doubt causes more and more conflicts in the future. Having a short guide about how to rename is not a solution I think. If you need to rename all your injections before starting a project, that's going to be a whole mess.

The solution is easy: just reducing the chance for conflict to appear by using more targeted name. So EPF should maybe use "data-session", Ember-Simple Auth "auth-session". This way the name is "kind of" namespaced, and there is really few chance to encounter another "auth-session" (because you likely don't use two auth libraries altogether).

@ncoquelet
Copy link
Author

Hi,

Last week, after create this issue, I have try to rename simpleAuth session object with success. (This is much easier than rename epf stuff)

So, I changed the container registration name to "sessionAuth:main" and the inject field to "sessionAuth", both are in conflict with epf.

I have commited in a fork at https://github.com/ncoquelet/ember-simple-auth

@ncoquelet
Copy link
Author

@bakura10 I have read somewhere, that ember have injection conflict solution, but as ember beginner i don't know all ember possibilities.

Otherwise, epf team suggest that maybe could be resolved by runtime configuration ...
getoutreach/epf#127

thanks both of you
open to all others suggestions

@marcoow
Copy link
Member

marcoow commented May 12, 2014

I added a "namespace" to the names that Ember.SimpleAuth registers its components with and made the name of the session property configurable: f2d94a8

@marcoow marcoow closed this as completed May 12, 2014
@ncoquelet
Copy link
Author

Work nice
Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants