@thunderid/browser 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2779,21 +2779,27 @@ var ThunderIDBrowserClient = class ThunderIDBrowserClient extends ThunderIDJavaS
2779
2779
  afterSignOut = afterSignOutParam;
2780
2780
  }
2781
2781
  const config = await this.getStorageManager().getConfigData();
2782
+ let signOutUrl = "";
2782
2783
  if (config?.rpInitiatedLogout !== false) {
2783
- let signOutUrl = sessionId ? "" : SPAUtils_default.getSignOutUrl(config.clientId, this._browserInstanceId);
2784
+ signOutUrl = sessionId ? "" : SPAUtils_default.getSignOutUrl(config.clientId, this._browserInstanceId);
2784
2785
  if (!signOutUrl) try {
2785
2786
  signOutUrl = await this.getSignOutUrl(sessionId);
2786
2787
  } catch (error) {
2787
2788
  logger$2.debug("Could not build the RP-initiated logout URL; falling back to a local sign out.", error);
2788
2789
  signOutUrl = "";
2789
2790
  }
2790
- if (signOutUrl) {
2791
- await this.clearSessionAsync(sessionId);
2792
- afterSignOut?.(signOutUrl);
2793
- location.href = signOutUrl;
2794
- await SPAUtils_default.waitTillPageRedirect();
2795
- return signOutUrl;
2796
- }
2791
+ }
2792
+ if (config?.tokenLifecycle?.revokeToken?.revokeOnSignOut === true) try {
2793
+ await this.requestAccessTokenRevocation(sessionId);
2794
+ } catch (error) {
2795
+ logger$2.debug("Could not revoke the access token before signing out.", error);
2796
+ }
2797
+ if (signOutUrl) {
2798
+ await this.clearSessionAsync(sessionId);
2799
+ afterSignOut?.(signOutUrl);
2800
+ location.href = signOutUrl;
2801
+ await SPAUtils_default.waitTillPageRedirect();
2802
+ return signOutUrl;
2797
2803
  }
2798
2804
  this.clearSession(sessionId);
2799
2805
  if (config?.signInUrl) navigate_default(config.signInUrl);