oidc-client-ts icon indicating copy to clipboard operation
oidc-client-ts copied to clipboard

Idle timeout

Open Vesa1 opened this issue 3 years ago • 1 comments

Hello, I have an issue with an idle timeout. Is there a way to detect a moment when the user is inactive for X minutes? I want to show him the popup a few minutes before the timeout so he can refresh the token. If he doesn't refresh the token, I want to log him out automatically. Is there a way to do that using React? Also, I would like to change the token expiration time, so I can test it easier, how can I do that? Thanks in advance!

Vesa1 avatar Jul 19 '22 13:07 Vesa1

you can register on events. See https://github.com/authts/oidc-client-ts/blob/a6ee4a60bc42d6c5c41f84c34a31728cfb571324/src/UserManager.ts#L107:

  • access token expiring
  • access token has expired
  • ...

pamapa avatar Jul 20 '22 10:07 pamapa