Comments (3)
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.
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:
and the identityConfigFactory:
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runtime-config-loader.