Git Product home page Git Product logo

Comments (3)

pjlamb12 avatar pjlamb12 commented on July 24, 2024

What I do for this is put the auth config inside the config.json file that is loaded in RuntimeConfigLoaderModule. And then in the code I get the authConfig from the service, and call the configure method from the OAuthService.

//app.component.ts

const authConfig = this._config.getConfigObjectKey('authModuleConfig');
this._oauth.configure(authConfig);

Does this answer the question? I've used this several times, in several apps, and it always works.

from runtime-config-loader.

atarazavi avatar atarazavi commented on July 24, 2024

Thank you for your response!
I think it doesn't answer in this case :(
In app.component.ts I have access to the loaded config files, the problem is with the AuthConfigModule which is a Module.
I can't put a module inside the config.json file.
I need the config data which is in the config.json file, inside the AuthConfigModule.
Here is the AuthConfigModule:
image

and the identityConfigFactory:
image

As you can see, I need the runtime config loaded data inside the AuthConfigModule's factory! But it's null because it's not loaded yet!
How can I use the method/trick you mentioned to force this module to wait for RuntimeConfigLoader to load config.json file?

from runtime-config-loader.

pjlamb12 avatar pjlamb12 commented on July 24, 2024

I don't know exactly how you're loading the Auth configuration, but like I said, in my app.component.ts file I get the auth config, and then use the OAuthService to set the configuration. This works just fine for me each time.

I don't know of any way to make the AuthModule wait to load until the RuntimeConfigLoaderModule has loaded.

In your case, if you're trying to load the config from a JSON file in that factory, I'd just load the JSON file directly and not try to get it from the runtime config loader.

from runtime-config-loader.

Related Issues (5)

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.