Hi. I’m using Angular 18 with standalone components.
Here is my example of initialise auth0 in my app
provideAuth0({
...environment.auth0,
authorizationParams: {
...environment.auth0.authorizationParams,
}
}),
in authorizationParams i need to add dynamic option. What does it mean?
My login page looks like “myapp.login/Yissdbeqwe”
where “Yissdbeqwe” is organization Id. Each organization has own content in my app, so i need to add organization Id to auth0 configuration in step of app initialise.
Is it possible to add some dynamic data to auth0 config before init? I tried with localStorage like this
{
provide: APP_INITIALIZER,
useFactory: (organizationService: OrganizationService) => () =>
organizationService.initializeOrganizationId(),
deps: [OrganizationService],
multi: true,
},
provideAuth0({
...environment.auth0,
authorizationParams: {
...environment.auth0.authorizationParams,
...JSON.parse(localStorage.getItem('organizationOptions') as any)
}
}),
in initializeOrganizationId i grab org id from url and set it to localStorage. and it almost works, but when i login first time it sends config to auth0 without my dynamic data and auth0 throw error with something like “ogranization param is missing” and after that it successfully grab org id from localStarage and login works well.
Is it support of dynamic data in config or maybe u have some documentation for it how to init auth0 with delay or something?