question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ember Simple Auth: The automatic session initialization is deprecated on Ember 3.28.4

See original GitHub issue

Ember simple auth version “^4.1.1” it’s sending this warning on Ember 3.28.4

How to replicate the problem?

  1. ember new app-test
  2. cd app-test
  3. ember install ember-simple-auth
  4. 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();
  }
}

image

you can replicate the problem on this repo

https://github.com/jdaviderb/ember-simple-auth-deprecated-session-initialization-

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
BobrImperatorcommented, Dec 10, 2021

@Thenkei maybe you included the useSessionSetupMethod in your environment.js instead of ember-cli-build.js? This is the only reason I can think of and it’d explain why adding the code to the load function works for you.

1reaction
BobrImperatorcommented, Dec 10, 2021

@Thenkei Glad it worked out 🚀

Why don’t you let both way to configure the addon ?

The reason for this is that useSessionSetupMethod will funnel out ApplicationRoute 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found