Open justinbmeyer opened 3 years ago
Any thoughts on this? I can work to submit a patch.
The main issue is my bottleneck: If it's a complicated solution, then I don't have time to review.
Ideally, it should just be putting a web-lock around the code that makes the refresh:
navigator.locks.request('oidc-client-refresh', async lock => {
await go_do_a_refresh();
});
And telling people to use the polyfill:
https://github.com/bitovi/web-locks-polyfill
Even better, we could feature detect if locks
exists:
if(navigator.locks) {
navigator.locks.request('oidc-client-refresh', async lock => {
await go_do_a_refresh();
});
} else {
go_do_a_refresh();
}
This would allow people to still use oidc-client without the polyfill in browsers that are missing web-locks.
If multiple tabs are using the same shared access/refresh token and one of the tabs starts renewing, can I prevent the other tabs from renewing and "piggy back" off the tab that is performing the renew?
Could https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API be used in browsers that support it?