Closed groberts314 closed 2 years ago
https://stackoverflow.com/questions/5346694/how-to-implement-a-lock-in-javascript
This might be a promise-ing (see what I did there...? :-P) idea to only make OIDC configuration / discovery requests once even if multiple callers on multiple threads are all trying to do their thing at once.
Basically, ensureUserManagerInitialized()
from being async/await to being Promise
-based.
Honestly, maybe the whole shebang should just be Promise
-based instead of async
/await
.
Moved this into MVP. Really it needs to be fixed prior to using the tool fulltime. Especially when site doesn't load correctly and just kind of hangs (typically because access token has expired and we need to log in again).
We might also consider seeing if we can refactor to use Redux OIDC.
See also #27 (silent renew) - we might or might not decide that is also MVP! =)
I think as of 13a778f (which adds double-checked sync locking pattern to the Authorize Service and is pretty successful at cutting down the number of calls the the OIDC client settings and discovery endpoints) this might be good enough for MVP.
Consider making a new issue for any further enhancements and conversion of all of the authorization components to TypeScript.
Additional work beyond MVP will be a part of #96.
Figure out how to avoid excess calls to OIDC configuration and discovery endpoints when multiple callers are making async calls