-
Notifications
You must be signed in to change notification settings - Fork 453
Open
Description
Version
main, all versions
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
checksession iframe stops after first run
Steps to reproduce the behavior
- in config set startCheckSession: true
- use session management OpenID Connect, we use OpenIddict server so for example: https://github.com/GREsau/openiddict-session-management-sample/
- register for EventTypes.CheckSessionReceived notification
I notice that it only fires once at app startup and does not perform any polling afterward.
A clear and concise description of what you expected to happen.
I expect the iframe to continuously poll the session state until either the user logs off from the other app or the session ends.
Additional context
I was curious, so I explored the code for the feature and found a condition in check-session.service.ts that is true only once, and then interrupts the recursion:
angular-auth-oidc-client/projects/angular-auth-oidc-client/src/lib/iframe/check-session.service.ts
Line 97 in 6fcacb4
| if (this.lastIFrameRefresh + this.iframeRefreshInterval > Date.now()) { |
Additionally, when this condition is true, returning of() stops the Observable in 'pollServerSessionRecur'. I believe that, based on the variable name 'iframeRefreshInterval', the iframe should be refreshed after the default interval of 60 seconds; otherwise, the loop should continue.
Metadata
Metadata
Assignees
Labels
No labels