@thunderid/browser 0.8.1 → 0.10.0

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
@@ -2823,10 +2823,30 @@ var ThunderIDBrowserClient = class ThunderIDBrowserClient extends ThunderIDJavaS
2823
2823
  }
2824
2824
  async signOut(_options, sessionIdOrAfterSignOut, afterSignOutParam) {
2825
2825
  let afterSignOut;
2826
+ let sessionId;
2826
2827
  if (typeof sessionIdOrAfterSignOut === "function") afterSignOut = sessionIdOrAfterSignOut;
2827
- else if (typeof sessionIdOrAfterSignOut === "string") afterSignOut = afterSignOutParam;
2828
+ else if (typeof sessionIdOrAfterSignOut === "string") {
2829
+ sessionId = sessionIdOrAfterSignOut;
2830
+ afterSignOut = afterSignOutParam;
2831
+ }
2828
2832
  const config = await this.getStorageManager().getConfigData();
2829
- this.clearSession();
2833
+ if (config?.rpInitiatedLogout !== false) {
2834
+ let signOutUrl = sessionId ? "" : SPAUtils_default.getSignOutUrl(config.clientId, this._browserInstanceId);
2835
+ if (!signOutUrl) try {
2836
+ signOutUrl = await this.getSignOutUrl(sessionId);
2837
+ } catch (error) {
2838
+ logger$2.debug("Could not build the RP-initiated logout URL; falling back to a local sign out.", error);
2839
+ signOutUrl = "";
2840
+ }
2841
+ if (signOutUrl) {
2842
+ await this.clearSessionAsync(sessionId);
2843
+ afterSignOut?.(signOutUrl);
2844
+ location.href = signOutUrl;
2845
+ await SPAUtils_default.waitTillPageRedirect();
2846
+ return signOutUrl;
2847
+ }
2848
+ }
2849
+ this.clearSession(sessionId);
2830
2850
  if (config?.signInUrl) navigate_default(config.signInUrl);
2831
2851
  else this.signIn(config?.signInOptions);
2832
2852
  afterSignOut?.(config?.afterSignOutUrl || "");
@@ -3505,6 +3525,14 @@ const ANONYMOUS_ENTITY_ICONS = {
3505
3525
  color: "#E0348E",
3506
3526
  markup: "<path d=\"M20 85 L20 50 Q20 15 50 15 Q80 15 80 50 L80 85 Z\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"10\"/>"
3507
3527
  },
3528
+ bot_head: {
3529
+ color: "#3B7DD8",
3530
+ markup: "<rect x=\"26\" y=\"30\" width=\"48\" height=\"42\" rx=\"12\" fill=\"#FFFFFF\"/>\n<circle cx=\"40\" cy=\"50\" r=\"5\" fill=\"%COLOR%\"/>\n<circle cx=\"60\" cy=\"50\" r=\"5\" fill=\"%COLOR%\"/>\n<rect x=\"46\" y=\"12\" width=\"8\" height=\"16\" fill=\"#FFFFFF\"/>\n<circle cx=\"50\" cy=\"10\" r=\"5\" fill=\"#FFFFFF\"/>\n<rect x=\"14\" y=\"45\" width=\"8\" height=\"14\" rx=\"3\" fill=\"#FFFFFF\"/>\n<rect x=\"78\" y=\"45\" width=\"8\" height=\"14\" rx=\"3\" fill=\"#FFFFFF\"/>"
3531
+ },
3532
+ brain: {
3533
+ color: "#7B3F9E",
3534
+ markup: "<path d=\"M50 15 Q30 15 28 32 Q14 34 16 50 Q10 58 18 66 Q18 80 34 80 Q38 88 50 85 Q62 88 66 80 Q82 80 82 66 Q90 58 84 50 Q86 34 72 32 Q70 15 50 15 Z\" fill=\"#FFFFFF\"/>\n<path d=\"M50 22 L50 78 M35 35 Q45 45 35 55 Q45 65 35 75 M65 35 Q55 45 65 55 Q55 65 65 75\" stroke=\"%COLOR%\" stroke-width=\"3\" fill=\"none\"/>"
3535
+ },
3508
3536
  bridge: {
3509
3537
  color: "#B5892C",
3510
3538
  markup: "<path d=\"M10 55 Q50 20 90 55\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"7\"/>\n<rect x=\"10\" y=\"55\" width=\"80\" height=\"8\" fill=\"#FFFFFF\"/>\n<rect x=\"20\" y=\"63\" width=\"6\" height=\"18\" fill=\"#FFFFFF\"/>\n<rect x=\"74\" y=\"63\" width=\"6\" height=\"18\" fill=\"#FFFFFF\"/>"
@@ -3553,6 +3581,10 @@ const ANONYMOUS_ENTITY_ICONS = {
3553
3581
  color: "#E0348E",
3554
3582
  markup: "<rect x=\"26\" y=\"45\" width=\"48\" height=\"38\" rx=\"6\" fill=\"#FFFFFF\"/>\n<path d=\"M34 45 L34 32 Q34 14 50 14 Q66 14 66 32 L66 45\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"8\"/>\n<circle cx=\"50\" cy=\"63\" r=\"6\" fill=\"%COLOR%\"/>"
3555
3583
  },
3584
+ neural_net: {
3585
+ color: "#2E9E9E",
3586
+ markup: "<circle cx=\"50\" cy=\"20\" r=\"8\" fill=\"#FFFFFF\"/>\n<circle cx=\"22\" cy=\"50\" r=\"8\" fill=\"#FFFFFF\"/>\n<circle cx=\"78\" cy=\"50\" r=\"8\" fill=\"#FFFFFF\"/>\n<circle cx=\"35\" cy=\"82\" r=\"8\" fill=\"#FFFFFF\"/>\n<circle cx=\"65\" cy=\"82\" r=\"8\" fill=\"#FFFFFF\"/>\n<path d=\"M50 20 L22 50 M50 20 L78 50 M22 50 L35 82 M22 50 L65 82 M78 50 L35 82 M78 50 L65 82\" stroke=\"#FFFFFF\" stroke-width=\"3\"/>"
3587
+ },
3556
3588
  obelisk: {
3557
3589
  color: "#5B6BC0",
3558
3590
  markup: "<polygon points=\"50,8 62,25 62,85 38,85 38,25\" fill=\"#FFFFFF\"/>"