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

Removed the use of play.api.Application and play.api.Cache singletons #178

Merged
merged 1 commit into from
Oct 18, 2017

Conversation

tototoshi
Copy link
Contributor

Since Play 2.4, the use of play.api.Application and play.api.Cache is deprecated and not recommended.
play.api.Cache singleton should be replaced with CacheApi and play.api.Application with Configuration/Environment.

To minimize the change, I think It's reasonable to add fields of CacheApi/Environment to AuthConfig trait. But it is not always the case for CacheApi. CacheApi is used only when CacheIdContainer is used as IdContainer. It is already discussed in #155. So I added idContainer field instead.

As for play.api.Environment which is the substitute of play.api.Application, I can say the same thing as CacheApi. It is used for only when CookieTokenAccessor.
However, should I added a tokenAccessor field to AuthConfig instead of Environment? It's a little difficult but I don't think it's necessary because Environment is also in AsyncAuth and much more commonly used than CacheApi in Play app.

@mikesname
Copy link
Contributor

This was very handy. I used it to get some Play 2.6 working with some extra changes: https://github.com/mikesname/play2-auth/tree/feature/play2.6

@gakuzzzz
Copy link
Member

Sorry too late response and thanks for this PR!

@gakuzzzz gakuzzzz merged commit e5df279 into t2v:master Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants