oidc-client-ts
oidc-client-ts copied to clipboard
renewal event fail in inactive tab
most browsers will throttle tab activities to preserve resources and battery life on the user’s device. with that, if a user switch away from the tab, token refresh timer won't work properly. looking at the web, the fix would be using web worker for the timer. should this lib incorporate a fix like that?
This is a known problem. I have the feeling using web worker will make everything even more complex...
We ran into this issue, too. Is there any good workaround right now?
I'm thinking of a solution via the Page Visibility API.
That could be also integrated in oidc-client-ts: Listen to hidden / visible state of the tab and push a refresh call when the tab get's visible again. @pamapa What do you think?
Maybe worth a try. Would help for cases where you still have a proper IDP session cookie or a vaild refresh token.