Ember Simple Auth: The automatic session initialization is deprecated on Ember 3.28.4
See original GitHub issueEmber simple auth version “^4.1.1” it’s sending this warning on Ember 3.28.4
How to replicate the problem?
- ember new app-test
- cd app-test
- ember install ember-simple-auth
- add this code on “application” route
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class Application extends Route {
@service session;
async beforeModel() {
await this.session.setup();
}
}
you can replicate the problem on this repo
https://github.com/jdaviderb/ember-simple-auth-deprecated-session-initialization-
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
ember-simple-auth/CHANGELOG.md at master - GitHub
Ember Simple Auth will no longer trigger a deprecation regarding use of the container property, see #894, #804, #796. The DataAdapterMixin will now...
Read more >Ember Simple Auth: 'authorize' is deprecated - Stack Overflow
I'm voting to close this question as off-topic because the solution is provided by the addon authors within the deprecation message. – Patsy ......
Read more >Fixing Ember Simple Auth Deprecation Warnings
Ember Simple Auth : Authorizers are deprecated in favour of setting headers directly. and · Ember Simple Auth: 'authorize' is deprecated.
Read more >ApplicationRouteMixin - ember-simple-auth
Deprecated :Call the session service's setup method in the application ... The session events can also be handled manually, e.g. in an instance...
Read more >How to use the ember-simple-auth/initializers/setup-session ...
initialize (registry) { let config = ENV['ember-simple-auth'] || {}; config.rootURL = ghostPaths().adminRoot; Configuration.load(config); setupSession(registry); ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Thenkei maybe you included the
useSessionSetupMethod
in yourenvironment.js
instead ofember-cli-build.js
? This is the only reason I can think of and it’d explain why adding the code to theload
function works for you.@Thenkei Glad it worked out 🚀
The reason for this is that
useSessionSetupMethod
will funnel outApplicationRoute
when set to true and there’s no easy way to read environment configuration from within ember-cli-build. We also need to funnel it out because otherwise it causes issues for typescript users as well as embroider.Hopefully I cleared out the question for you. The PR and linked issues might also be able to answer this https://github.com/simplabs/ember-simple-auth/pull/2318