Improve the `provide` function in order to allow passing a factory function
Description
In some cases, we could need to use some other providers in order to configure auth0. In this regard, I added the possibility to also provide a factory function and not just a basic value to allow this.
provideAuth0(() => {
const someProvider = inject(SomeProvider);
return {
...
/* we can now use someProvider here */
}
});
This improvement doesn't include any breaking change.
Testing
There is no existing unit tests for this provide function.
You can manually test it by playing with the playground, using this provide function and passing a factory function instead of an object.
Checklist
- [x] I have added documentation for new/changed functionality in this PR or in auth0.com/docs
- [x] All active GitHub checks for tests, formatting, and security are passing
- [x] The correct base branch is being used, if not the default branch
About the Example.md formatting changes, it seems that there is a git hook behind but I can't find it...
I guess that the new formatting isn't wanted, right?
Hi @LcsGa, thank you for contributing to Auth0! Please note that we have acknowledged this request and will consider incorporating this into the codebase for the next minor release of auth0-angular. While we are aware of this request, since this is a new feature with no prior tests, we cannot provide an accurate timeline yet, but you can expect activity on this in January 2025. Thanks.
Hi! any news on this?