@sesamy/sesamy-js 1.124.0 → 1.125.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.
@@ -1 +1 @@
1
- var sesamyBootstrap=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=e.namespace||`sesamy`,n=e.fallbackSrc,r=e.version||`stable`,i=e.environment===`dev`?`scripts.sesamy.dev`:`scripts.sesamy.com`,a=e.debug?function(...e){try{console.log.apply(console,[`[sesamy-boot]`].concat(e))}catch{}}:function(){},o={};try{let e=document.getElementById(`sesamy-js`);e&&e.textContent&&(o=JSON.parse(e.textContent)||{})}catch{}let s=e.clientId||o.clientId,c=s?`https://`+i+`/s/`+s:``,l=e.src||(s?c+`/sesamy-js/`+r+`.js`:void 0),u=!e.src&&!!c,d=window;if(!e.skipAuthPrefetch&&!d.__sesamyBoot){let t=null;try{let e=sessionStorage.getItem(`sesamy:userinfo`);if(e){let n=JSON.parse(e),r=n._cachedAt;r&&Date.now()-r<=36e5&&(t=n)}}catch{}if(t)d.__sesamyBoot=Promise.resolve(t),a(`userinfo: sessionStorage cache`);else if((`; `+document.cookie).indexOf(`; sesamy_is_authenticated=true`)>=0){var f=e.apiBaseUrl===void 0?o.auth&&o.auth.baseUrl||``:e.apiBaseUrl;a(`userinfo: fetching (hint cookie set)`,f+`/auth/userinfo`),d.__sesamyBoot=fetch(f+`/auth/userinfo`,{credentials:`include`,headers:{Accept:`application/json`}}).then(e=>e.ok?e.json():null).catch(()=>null)}else a(`userinfo: skipped (no hint cookie)`)}else e.skipAuthPrefetch&&a(`userinfo: skipped (skipAuthPrefetch)`);if(!l){a(`no coreSrc — neither clientId nor src resolved; nothing to load`);return}let p=o.auth&&o.auth.useHttpCookies===!0,m=u&&(e.loadAuth0Plugin===void 0?!p:e.loadAuth0Plugin),h=u&&(e.loadCapsulePlugin===void 0?o.capsule&&o.capsule.enabled===!0:e.loadCapsulePlugin),g=u&&!e.skipComponents;a(`chain`,{canChain:u,loadAuth:m,authSource:e.loadAuth0Plugin===void 0?`config`:`option`,loadCapsule:h,capsuleSource:e.loadCapsulePlugin===void 0?`config`:`option`,loadComponents:g});let _=e.auth0PluginVersion||r,v=e.capsulePluginVersion||r,y=e.componentsVersion||r,b=[];m&&b.push(c+`/auth0-plugin/`+_+`.js`),h&&b.push(c+`/capsule-plugin/`+v+`.js`),g&&b.push(c+`/sesamy-components/`+y+`.js`),b.push(l);let x=!1,S=e=>{if(x||!n)return;if(d[t]||d.__sesamyLoaded){a(`fallback: skipped (`+e+`; core loaded)`);return}x=!0,a(`fallback: firing (`+e+`)`,n);let r=document.createElement(`script`);r.src=n,r.async=!0,document.head.appendChild(r)},C=null;for(let t of b){a(`injecting`,t);let n=document.createElement(`script`);n.src=t,n.async=!1,e.debug&&(n.onload=function(){a(`loaded`,t)}),document.head.appendChild(n),t===l&&(C=n)}C&&(C.onerror=function(){S(`core onerror`)}),n&&setTimeout(function(){S(`timeout`)},e.fallbackTimeoutMs||3e3)}function n(e){return`(`+t.toString()+`)(`+JSON.stringify(e)+`);`}var r=[`clientId`,`environment`,`version`,`componentsVersion`,`auth0PluginVersion`,`capsulePluginVersion`,`src`,`fallbackSrc`,`fallbackTimeoutMs`,`apiBaseUrl`,`namespace`,`skipAuthPrefetch`,`skipComponents`,`loadAuth0Plugin`,`loadCapsulePlugin`,`debug`];if(typeof window<`u`){window.sesamyBootstrap=t;try{let e=document.getElementById(`sesamy-js`),n=e&&e.textContent?JSON.parse(e.textContent):null;if(n&&(n.clientId||n.src)){let e={};for(let t of r)n[t]!==void 0&&(e[t]=n[t]);t(e)}}catch{}}return e.renderBootstrapScript=n,e.sesamyBootstrap=t,e})({});
1
+ var sesamyBootstrap=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=e.namespace||`sesamy`,n=e.fallbackSrc,r=e.version||`stable`,i=e.environment===`dev`?`scripts.sesamy.dev`:`scripts.sesamy.com`,a=e.debug?function(...e){try{console.log.apply(console,[`[sesamy-boot]`].concat(e))}catch{}}:function(){},o={};try{let e=document.getElementById(`sesamy-js`);e&&e.textContent&&(o=JSON.parse(e.textContent)||{})}catch{}let s=e.clientId||o.clientId,c=s?`https://`+i+`/s/`+s:``,l=e.src||(s?c+`/sesamy-js/`+r+`.js`:void 0),u=!e.src&&!!c,d=window;if(!e.skipAuthPrefetch&&!d.__sesamyBoot){let t=o.auth&&o.auth.vendorId||o.vendorId||s||``,n=t?`sesamy_is_authenticated_`+t:`sesamy_is_authenticated`,r=t?`sesamy:userinfo:`+t:`sesamy:userinfo`,i=null;try{let e=sessionStorage.getItem(r);if(e){let t=JSON.parse(e),n=t._cachedAt;n&&Date.now()-n<=36e5&&(i=t)}}catch{}if(i)d.__sesamyBoot=Promise.resolve(i),a(`userinfo: sessionStorage cache`);else if((`; `+document.cookie).indexOf(`; `+n+`=true`)>=0){var f=e.apiBaseUrl===void 0?o.auth&&o.auth.baseUrl||``:e.apiBaseUrl;a(`userinfo: fetching (hint cookie set)`,f+`/auth/userinfo`),d.__sesamyBoot=fetch(f+`/auth/userinfo`,{credentials:`include`,headers:{Accept:`application/json`}}).then(e=>e.ok?e.json():null).catch(()=>null)}else a(`userinfo: skipped (no hint cookie)`)}else e.skipAuthPrefetch&&a(`userinfo: skipped (skipAuthPrefetch)`);if(!l){a(`no coreSrc — neither clientId nor src resolved; nothing to load`);return}let p=o.auth&&o.auth.useHttpCookies===!0,m=u&&(e.loadAuth0Plugin===void 0?!p:e.loadAuth0Plugin),h=u&&(e.loadCapsulePlugin===void 0?o.capsule&&o.capsule.enabled===!0:e.loadCapsulePlugin),g=u&&!e.skipComponents;a(`chain`,{canChain:u,loadAuth:m,authSource:e.loadAuth0Plugin===void 0?`config`:`option`,loadCapsule:h,capsuleSource:e.loadCapsulePlugin===void 0?`config`:`option`,loadComponents:g});let _=e.auth0PluginVersion||r,v=e.capsulePluginVersion||r,y=e.componentsVersion||r,b=[];m&&b.push(c+`/auth0-plugin/`+_+`.js`),h&&b.push(c+`/capsule-plugin/`+v+`.js`),g&&b.push(c+`/sesamy-components/`+y+`.js`),b.push(l);let x=!1,S=e=>{if(x||!n)return;if(d[t]||d.__sesamyLoaded){a(`fallback: skipped (`+e+`; core loaded)`);return}x=!0,a(`fallback: firing (`+e+`)`,n);let r=document.createElement(`script`);r.src=n,r.async=!0,document.head.appendChild(r)},C=null;for(let t of b){a(`injecting`,t);let n=document.createElement(`script`);n.src=t,n.async=!1,e.debug&&(n.onload=function(){a(`loaded`,t)}),document.head.appendChild(n),t===l&&(C=n)}C&&(C.onerror=function(){S(`core onerror`)}),n&&setTimeout(function(){S(`timeout`)},e.fallbackTimeoutMs||3e3)}function n(e){return`(`+t.toString()+`)(`+JSON.stringify(e)+`);`}var r=[`clientId`,`environment`,`version`,`componentsVersion`,`auth0PluginVersion`,`capsulePluginVersion`,`src`,`fallbackSrc`,`fallbackTimeoutMs`,`apiBaseUrl`,`namespace`,`skipAuthPrefetch`,`skipComponents`,`loadAuth0Plugin`,`loadCapsulePlugin`,`debug`];if(typeof window<`u`){window.sesamyBootstrap=t;try{let e=document.getElementById(`sesamy-js`),n=e&&e.textContent?JSON.parse(e.textContent):null;if(n&&(n.clientId||n.src)){let e={};for(let t of r)n[t]!==void 0&&(e[t]=n[t]);t(e)}}catch{}}return e.renderBootstrapScript=n,e.sesamyBootstrap=t,e})({});
@@ -11,16 +11,16 @@ function e(e) {
11
11
  } catch {}
12
12
  let s = e.clientId || o.clientId, c = s ? "https://" + i + "/s/" + s : "", l = e.src || (s ? c + "/sesamy-js/" + r + ".js" : void 0), u = !e.src && !!c, d = window;
13
13
  if (!e.skipAuthPrefetch && !d.__sesamyBoot) {
14
- let t = null;
14
+ let t = o.auth && o.auth.vendorId || o.vendorId || s || "", n = t ? "sesamy_is_authenticated_" + t : "sesamy_is_authenticated", r = t ? "sesamy:userinfo:" + t : "sesamy:userinfo", i = null;
15
15
  try {
16
- let e = sessionStorage.getItem("sesamy:userinfo");
16
+ let e = sessionStorage.getItem(r);
17
17
  if (e) {
18
- let n = JSON.parse(e), r = n._cachedAt;
19
- r && Date.now() - r <= 36e5 && (t = n);
18
+ let t = JSON.parse(e), n = t._cachedAt;
19
+ n && Date.now() - n <= 36e5 && (i = t);
20
20
  }
21
21
  } catch {}
22
- if (t) d.__sesamyBoot = Promise.resolve(t), a("userinfo: sessionStorage cache");
23
- else if (("; " + document.cookie).indexOf("; sesamy_is_authenticated=true") >= 0) {
22
+ if (i) d.__sesamyBoot = Promise.resolve(i), a("userinfo: sessionStorage cache");
23
+ else if (("; " + document.cookie).indexOf("; " + n + "=true") >= 0) {
24
24
  var f = e.apiBaseUrl === void 0 ? o.auth && o.auth.baseUrl || "" : e.apiBaseUrl;
25
25
  a("userinfo: fetching (hint cookie set)", f + "/auth/userinfo"), d.__sesamyBoot = fetch(f + "/auth/userinfo", {
26
26
  credentials: "include",