GithubHelp home page GithubHelp logo

Comments (9)

BobrImperator avatar BobrImperator commented on June 4, 2024 2

@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.

from ember-simple-auth.

BobrImperator avatar BobrImperator commented on June 4, 2024 1

@Thenkei If it's not working then it's a bug.

But notice that useSessionSetupMethod is imported from a file that's created during build time - this was the only way to expose build time variable to runtime that we could think of.
The load function on the other hand is for loading environment configs.

from ember-simple-auth.

BobrImperator avatar BobrImperator commented on June 4, 2024 1

@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 #2318

from ember-simple-auth.

BobrImperator avatar BobrImperator commented on June 4, 2024

Hi, thanks for reporting this as well as the reproduction ❤️

This feature currently is optional since 4.1.0 and requires additional configuration inside ember-cli-build.js file in order to get rid of the deprecation.
Later on we plan to make it the default behaviour.

Here's the documentation for this:
https://github.com/simplabs/ember-simple-auth/blob/master/guides/upgrade-to-v4.md

from ember-simple-auth.

Thenkei avatar Thenkei commented on June 4, 2024

Hello @BobrImperator,

This feature currently is optional since 4.1.0 and requires additional configuration inside ember-cli-build.js file in order to get rid of the deprecation.

I might be wrong but this config is not loaded for now.. I think you missed the load function that should override the useSessionSetupMethod value.

https://github.com/simplabs/ember-simple-auth/blob/76410f1733013083b0bd20d92528985d793c07c2/packages/ember-simple-auth/addon/configuration.js#L53-L58

When it should be

  load(config) {
    this.rootURL = config.rootURL !== undefined ? config.rootURL : DEFAULTS.rootURL;
    this.routeAfterAuthentication =
      config.routeAfterAuthentication !== undefined
        ? config.routeAfterAuthentication
        : DEFAULTS.routeAfterAuthentication;
    // Here is the missing line
    this.useSessionSetupMethod = config.useSessionSetupMethod;
  },

from ember-simple-auth.

Thenkei avatar Thenkei commented on June 4, 2024

But notice that useSessionSetupMethod is imported from a file that's created during build time - this was the only way to expose build time variable to runtime that we could think of.

It make sense (at first glance I didn't get the 'ember-simple-auth/use-session-setup-method' import). It's weird in this case I should have an issue in my build process I will try to dig.
In the other hand, I tried my change (on the load function) and it works. 🤔

from ember-simple-auth.

Thenkei avatar Thenkei commented on June 4, 2024

@BobrImperator you're totally right.

Inside your ember-cli-build.js you'll need to add useSessionSetupMethod flag and set it to true:

I missed that one. Why don't you let both way to configure the addon ? I found this quite confusing since the rest of the config is done in the environment.js.

Anyway, thanks for your time. 🙏

from ember-simple-auth.

Thenkei avatar Thenkei commented on June 4, 2024

Thanks for this really clear answer. I got it now. 🙏

Thanks again.

Kind regards

from ember-simple-auth.

BobrImperator avatar BobrImperator commented on June 4, 2024

I'm closing this since it looks like the issue has been resolved.
Feel free to re-open in case it's not resolved.

from ember-simple-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.