I am developing SPA applications using ReactJS and the react-oidc-context
library. All of these SPAs are OIDC-protected Wizards that the user closes/leaves once the wizard is complete.
When the user closed/leaves the wizard, I want to revoke the access tokens they were issued when they initially launched the wizard.
Putting a 'Close' button that revokes the token when the user completes the wizard is easy enough. However, I am stuck on detecting when the user attempts to close/cancel the wizard prematurely. For example, the user starts the wizard and then navigates away to another site. When that occurs, I want to revoke the access token.
How can I detect when a user tries to close/navigate away from a wizard?