Auth0 rules that were async were running as a race condition. This addresses it and properly waits for async rules to complete before returning a token.
Approach
We made this route async and wrap the vm in a Promise that it can call when it is ready to resolve in the script. Inspiration from SO.
Motivation
Auth0 rules that were async were running as a race condition. This addresses it and properly waits for async rules to complete before returning a token.
Approach
We made this route async and wrap the
vm
in a Promise that it can call when it is ready to resolve in the script. Inspiration from SO.