@sesamy/sesamy-js 1.125.2 → 1.125.3
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/auth0-plugin.iife.js +1 -1
- package/dist/auth0-plugin.mjs +35 -33
- package/dist/bootstrap.iife.js +1 -1
- package/dist/bootstrap.mjs +1 -1
- package/dist/sesamy-js.cjs +4 -4
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +79 -78
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -2512,44 +2512,46 @@ function Yn() {
|
|
|
2512
2512
|
function Xn(e) {
|
|
2513
2513
|
return e.vendorId || e.clientId || "";
|
|
2514
2514
|
}
|
|
2515
|
-
|
|
2516
|
-
return e ? `sesamy_is_authenticated_${e}` : "sesamy_is_authenticated";
|
|
2517
|
-
}
|
|
2515
|
+
var Zn = "sesamy_is_authenticated";
|
|
2518
2516
|
function Qn(e) {
|
|
2519
|
-
return e ? `
|
|
2517
|
+
return e ? `sesamy_is_authenticated_${e}` : Zn;
|
|
2520
2518
|
}
|
|
2521
2519
|
function $n(e) {
|
|
2520
|
+
return e ? `sesamy:userinfo:${e}` : "sesamy:userinfo";
|
|
2521
|
+
}
|
|
2522
|
+
function er(e) {
|
|
2522
2523
|
if (typeof document > "u") return !1;
|
|
2523
|
-
let t =
|
|
2524
|
+
let t = [Qn(e)];
|
|
2525
|
+
e && t.push(Zn);
|
|
2524
2526
|
try {
|
|
2525
|
-
return document.cookie.split(";").some((e) => e.trim().startsWith(`${t}=true`));
|
|
2527
|
+
return document.cookie.split(";").some((e) => t.some((t) => e.trim().startsWith(`${t}=true`)));
|
|
2526
2528
|
} catch {
|
|
2527
2529
|
return !1;
|
|
2528
2530
|
}
|
|
2529
2531
|
}
|
|
2530
|
-
function
|
|
2532
|
+
function tr(e, t) {
|
|
2531
2533
|
if (typeof document > "u" || typeof window > "u") return;
|
|
2532
|
-
let n =
|
|
2534
|
+
let n = Qn(e);
|
|
2533
2535
|
try {
|
|
2534
2536
|
let e = t ? 720 * 60 * 60 : 0, r = window.location.protocol === "https:" ? "; Secure" : "";
|
|
2535
2537
|
document.cookie = `${n}=${t}; path=/; max-age=${e}; SameSite=Lax${r}`;
|
|
2536
2538
|
} catch {}
|
|
2537
2539
|
}
|
|
2538
2540
|
Vn(), zn();
|
|
2539
|
-
var
|
|
2540
|
-
function
|
|
2541
|
+
var nr = "sesamy:legacy-migration-attempted";
|
|
2542
|
+
function rr() {
|
|
2541
2543
|
try {
|
|
2542
|
-
return sessionStorage.getItem(
|
|
2544
|
+
return sessionStorage.getItem(nr) === "1";
|
|
2543
2545
|
} catch {
|
|
2544
2546
|
return !1;
|
|
2545
2547
|
}
|
|
2546
2548
|
}
|
|
2547
|
-
function
|
|
2549
|
+
function ir() {
|
|
2548
2550
|
try {
|
|
2549
|
-
sessionStorage.setItem(
|
|
2551
|
+
sessionStorage.setItem(nr, "1");
|
|
2550
2552
|
} catch {}
|
|
2551
2553
|
}
|
|
2552
|
-
function
|
|
2554
|
+
function ar() {
|
|
2553
2555
|
try {
|
|
2554
2556
|
for (let e of Object.keys(localStorage)) if (e.startsWith("@@auth0spajs@@")) try {
|
|
2555
2557
|
let t = JSON.parse(localStorage.getItem(e) || "{}");
|
|
@@ -2559,7 +2561,7 @@ function ir() {
|
|
|
2559
2561
|
} catch {}
|
|
2560
2562
|
return !1;
|
|
2561
2563
|
}
|
|
2562
|
-
function
|
|
2564
|
+
function or() {
|
|
2563
2565
|
try {
|
|
2564
2566
|
for (let e of Object.keys(localStorage)) e.startsWith("@@auth0spajs@@") && localStorage.removeItem(e);
|
|
2565
2567
|
localStorage.removeItem("sesamyRefreshToken"), localStorage.removeItem("sesamyAccessToken");
|
|
@@ -2567,7 +2569,7 @@ function ar() {
|
|
|
2567
2569
|
document.cookie = `auth0.is.authenticated=; path=/; max-age=0; SameSite=Lax${e}`;
|
|
2568
2570
|
} catch {}
|
|
2569
2571
|
}
|
|
2570
|
-
function
|
|
2572
|
+
function sr() {
|
|
2571
2573
|
try {
|
|
2572
2574
|
let e = document.getElementById("sesamy-server-state");
|
|
2573
2575
|
return e?.textContent ? JSON.parse(e.textContent) : null;
|
|
@@ -2575,7 +2577,7 @@ function or() {
|
|
|
2575
2577
|
return null;
|
|
2576
2578
|
}
|
|
2577
2579
|
}
|
|
2578
|
-
function
|
|
2580
|
+
function cr(e) {
|
|
2579
2581
|
try {
|
|
2580
2582
|
let t = e.split(".");
|
|
2581
2583
|
if (t.length !== 3) return null;
|
|
@@ -2585,8 +2587,8 @@ function sr(e) {
|
|
|
2585
2587
|
return null;
|
|
2586
2588
|
}
|
|
2587
2589
|
}
|
|
2588
|
-
function
|
|
2589
|
-
let t = e.baseUrl ?? "", n = "", r = !1, i = null, a = null, o =
|
|
2590
|
+
function lr(e = {}) {
|
|
2591
|
+
let t = e.baseUrl ?? "", n = "", r = !1, i = null, a = null, o = $n("");
|
|
2590
2592
|
function s() {
|
|
2591
2593
|
try {
|
|
2592
2594
|
let e = sessionStorage.getItem(o);
|
|
@@ -2634,16 +2636,16 @@ function cr(e = {}) {
|
|
|
2634
2636
|
}
|
|
2635
2637
|
let d = {
|
|
2636
2638
|
async init(e) {
|
|
2637
|
-
n = Xn(e), o =
|
|
2638
|
-
let s =
|
|
2639
|
+
n = Xn(e), o = $n(n), q(`[cookie-auth] Initializing with baseUrl: ${t}`);
|
|
2640
|
+
let s = sr(), l = e.idToken || s?.idToken;
|
|
2639
2641
|
if (l) {
|
|
2640
|
-
let e =
|
|
2642
|
+
let e = cr(l);
|
|
2641
2643
|
if (e && typeof e.exp == "number" && e.exp > Date.now() / 1e3) {
|
|
2642
2644
|
let t = {
|
|
2643
2645
|
...e,
|
|
2644
2646
|
authenticated: !0
|
|
2645
2647
|
};
|
|
2646
|
-
i = !0, a = t,
|
|
2648
|
+
i = !0, a = t, tr(n, !0), c(t), q(`[cookie-auth] Using server-injected id-token for sub: ${e.sub}`), Wn(J.AUTHENTICATED, {
|
|
2647
2649
|
sub: e.sub,
|
|
2648
2650
|
appState: void 0
|
|
2649
2651
|
}), r = !0, Wn(J.AUTH_INITIALIZED, {});
|
|
@@ -2651,23 +2653,23 @@ function cr(e = {}) {
|
|
|
2651
2653
|
}
|
|
2652
2654
|
q("[cookie-auth] Server-injected id-token is expired or invalid — falling through");
|
|
2653
2655
|
}
|
|
2654
|
-
if (
|
|
2656
|
+
if (er(n)) {
|
|
2655
2657
|
let e = await u();
|
|
2656
|
-
e === null ? q("[cookie-auth] userinfo fetch failed transiently; retaining session hint") : e.authenticated && e.sub ? (i = !0, a = e,
|
|
2658
|
+
e === null ? q("[cookie-auth] userinfo fetch failed transiently; retaining session hint") : e.authenticated && e.sub ? (i = !0, a = e, tr(n, !0), Wn(J.AUTHENTICATED, {
|
|
2657
2659
|
sub: e.sub,
|
|
2658
2660
|
appState: void 0
|
|
2659
|
-
})) : (i = !1,
|
|
2661
|
+
})) : (i = !1, tr(n, !1), c(null));
|
|
2660
2662
|
} else i = !1;
|
|
2661
2663
|
if (e.migrateLegacySession && i === !1) {
|
|
2662
|
-
if (
|
|
2663
|
-
|
|
2664
|
+
if (ar() && !rr()) {
|
|
2665
|
+
ir(), q("[cookie-auth] Legacy Auth0 session found — attempting silent BFF migration"), await d.login({
|
|
2664
2666
|
prompt: "none",
|
|
2665
2667
|
returnTo: window.location.href
|
|
2666
2668
|
});
|
|
2667
2669
|
return;
|
|
2668
2670
|
}
|
|
2669
|
-
|
|
2670
|
-
} else e.migrateLegacySession && i === !0 &&
|
|
2671
|
+
or();
|
|
2672
|
+
} else e.migrateLegacySession && i === !0 && or();
|
|
2671
2673
|
r = !0, Wn(J.AUTH_INITIALIZED, {});
|
|
2672
2674
|
},
|
|
2673
2675
|
async isAuthenticated() {
|
|
@@ -2715,16 +2717,16 @@ function cr(e = {}) {
|
|
|
2715
2717
|
});
|
|
2716
2718
|
if (!o.ok) return q(`[cookie-auth] refresh: userinfo returned ${o.status}`), e;
|
|
2717
2719
|
let s = await o.json();
|
|
2718
|
-
return s.authenticated && s.sub ? (i = !0, a = s,
|
|
2720
|
+
return s.authenticated && s.sub ? (i = !0, a = s, tr(n, !0), c(s), (!e || r !== s.sub) && Wn(J.AUTHENTICATED, {
|
|
2719
2721
|
sub: s.sub,
|
|
2720
2722
|
appState: void 0
|
|
2721
|
-
}), !0) : (i = !1, a = null,
|
|
2723
|
+
}), !0) : (i = !1, a = null, tr(n, !1), e && Wn(J.LOGOUT, {}), !1);
|
|
2722
2724
|
} catch (t) {
|
|
2723
2725
|
return q(`[cookie-auth] refresh failed: ${t.message}`), e;
|
|
2724
2726
|
}
|
|
2725
2727
|
},
|
|
2726
2728
|
async logout(e) {
|
|
2727
|
-
i = !1, a = null,
|
|
2729
|
+
i = !1, a = null, tr(n, !1), c(null), Wn(J.LOGOUT, {});
|
|
2728
2730
|
let r = e?.returnTo ?? window.location.href, o = new URL(`${t}/auth/${encodeURIComponent(n)}/logout`, window.location.origin);
|
|
2729
2731
|
o.searchParams.set("return_to", r), e?.localOnly && o.searchParams.set("local_only", "true"), window.location.href = o.toString();
|
|
2730
2732
|
}
|
|
@@ -2734,45 +2736,42 @@ function cr(e = {}) {
|
|
|
2734
2736
|
//#endregion
|
|
2735
2737
|
//#region src/services/auth/index.ts
|
|
2736
2738
|
zn();
|
|
2737
|
-
var
|
|
2738
|
-
function
|
|
2739
|
+
var ur = "sesamyAccessToken", dr = !1;
|
|
2740
|
+
function fr() {
|
|
2739
2741
|
let e = Jn();
|
|
2740
2742
|
if (!e) throw Error("[sesamy-js] No auth plugin registered. This should not happen.");
|
|
2741
2743
|
return e;
|
|
2742
2744
|
}
|
|
2743
|
-
async function
|
|
2745
|
+
async function pr(e) {
|
|
2744
2746
|
if (e.enabled === !1) {
|
|
2745
|
-
q("Auth disabled via config"),
|
|
2747
|
+
q("Auth disabled via config"), dr = !0;
|
|
2746
2748
|
return;
|
|
2747
2749
|
}
|
|
2748
|
-
e.useHttpCookies ? (q("useHttpCookies=true — using cookie-based BFF plugin"), qn(
|
|
2750
|
+
e.useHttpCookies ? (q("useHttpCookies=true — using cookie-based BFF plugin"), qn(lr({ baseUrl: e.baseUrl }))) : Jn() || (q("No auth plugin registered — falling back to cookie-based BFF plugin"), qn(lr({ baseUrl: e.baseUrl }))), Xn(e), await fr().init(e), dr = !0;
|
|
2749
2751
|
}
|
|
2750
|
-
async function
|
|
2751
|
-
return
|
|
2752
|
+
async function mr() {
|
|
2753
|
+
return dr ? fr().isAuthenticated() : !1;
|
|
2752
2754
|
}
|
|
2753
|
-
async function
|
|
2754
|
-
return
|
|
2755
|
-
}
|
|
2756
|
-
async function hr() {
|
|
2757
|
-
return ur ? dr().getUser() : null;
|
|
2755
|
+
async function hr(e = !0, t = !1) {
|
|
2756
|
+
return dr ? fr().getTokenSilently(e, t) : null;
|
|
2758
2757
|
}
|
|
2759
2758
|
function gr() {
|
|
2760
|
-
return
|
|
2759
|
+
return dr ? Jn()?.getProxyAuthBaseUrl?.() ?? null : null;
|
|
2761
2760
|
}
|
|
2762
2761
|
async function _r(e) {
|
|
2763
|
-
return
|
|
2762
|
+
return fr().login(e);
|
|
2764
2763
|
}
|
|
2765
2764
|
async function vr(e) {
|
|
2766
|
-
return
|
|
2765
|
+
return fr().loginWithRedirect(e);
|
|
2767
2766
|
}
|
|
2768
2767
|
async function yr(e) {
|
|
2769
|
-
return
|
|
2768
|
+
return fr().loginWithPopup(e);
|
|
2770
2769
|
}
|
|
2771
2770
|
async function br(e = {}) {
|
|
2772
|
-
return
|
|
2771
|
+
return fr().logout(e);
|
|
2773
2772
|
}
|
|
2774
2773
|
async function xr() {
|
|
2775
|
-
if (!
|
|
2774
|
+
if (!dr) return !1;
|
|
2776
2775
|
let e = Jn();
|
|
2777
2776
|
return e ? typeof e.refresh == "function" ? e.refresh() : e.isAuthenticated() : !1;
|
|
2778
2777
|
}
|
|
@@ -2781,7 +2780,7 @@ async function Sr(e) {
|
|
|
2781
2780
|
if (t.length !== 3) throw Error("Invalid token");
|
|
2782
2781
|
let n = decodeURIComponent(atob(t[1].replace(/-/g, "+").replace(/_/g, "/")).split("").map((e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), r = JSON.parse(n);
|
|
2783
2782
|
if (!r?.exp || r.exp < Date.now() / 1e3) throw Error("Invalid token");
|
|
2784
|
-
q("Set token"), localStorage.setItem(
|
|
2783
|
+
q("Set token"), localStorage.setItem(ur, e);
|
|
2785
2784
|
let { triggerEvent: i } = await Promise.resolve().then(() => (Gn(), Hn)), { Events: a } = await Promise.resolve().then(() => (Vn(), Bn));
|
|
2786
2785
|
i(a.AUTHENTICATED, {
|
|
2787
2786
|
...r,
|
|
@@ -5443,7 +5442,7 @@ function Cc() {
|
|
|
5443
5442
|
}
|
|
5444
5443
|
//#endregion
|
|
5445
5444
|
//#region package.json
|
|
5446
|
-
var wc = "@sesamy/sesamy-js", Tc = "1.125.
|
|
5445
|
+
var wc = "@sesamy/sesamy-js", Tc = "1.125.3";
|
|
5447
5446
|
//#endregion
|
|
5448
5447
|
//#region src/services/analytics/listeners/route.ts
|
|
5449
5448
|
function Ec(e) {
|
|
@@ -6526,8 +6525,8 @@ function Tu(e) {
|
|
|
6526
6525
|
baseUrl: t,
|
|
6527
6526
|
tokenProvider: async () => {
|
|
6528
6527
|
if (r) return null;
|
|
6529
|
-
if (await
|
|
6530
|
-
let e = await
|
|
6528
|
+
if (await mr()) try {
|
|
6529
|
+
let e = await hr(!1);
|
|
6531
6530
|
if (e) return `Bearer ${e}`;
|
|
6532
6531
|
if (n) return null;
|
|
6533
6532
|
} catch {}
|
|
@@ -6554,9 +6553,9 @@ function Tu(e) {
|
|
|
6554
6553
|
...n,
|
|
6555
6554
|
credentials: "include"
|
|
6556
6555
|
}), s = (e = !0) => (t) => async (r, i) => {
|
|
6557
|
-
let a = await
|
|
6556
|
+
let a = await hr(e);
|
|
6558
6557
|
if (!a) {
|
|
6559
|
-
if (n && await
|
|
6558
|
+
if (n && await mr()) return t(r, {
|
|
6560
6559
|
...i,
|
|
6561
6560
|
credentials: "include"
|
|
6562
6561
|
});
|
|
@@ -6583,7 +6582,7 @@ function Tu(e) {
|
|
|
6583
6582
|
})
|
|
6584
6583
|
]);
|
|
6585
6584
|
async function l(e = {}) {
|
|
6586
|
-
let { waitForEntitlementAfter: t, includeSignedLinks: n = !0 } = e, r = await
|
|
6585
|
+
let { waitForEntitlementAfter: t, includeSignedLinks: n = !0 } = e, r = await mr() ? await i.entitlements.list({ waitForEntitlementAfter: t?.toISOString() }) : [];
|
|
6587
6586
|
return n && r.push(...ma()), r;
|
|
6588
6587
|
}
|
|
6589
6588
|
async function u(e, t = []) {
|
|
@@ -6603,7 +6602,7 @@ function Tu(e) {
|
|
|
6603
6602
|
}
|
|
6604
6603
|
async function f(e) {
|
|
6605
6604
|
if (!e) throw Error("SKU is required to get fulfillments");
|
|
6606
|
-
return await
|
|
6605
|
+
return await mr() ? await c.get(`/fulfillments?sku=${encodeURIComponent(e)}`).json() : [];
|
|
6607
6606
|
}
|
|
6608
6607
|
async function p(e, t) {
|
|
6609
6608
|
if (!e || !t) throw Error("SKU and itemId are required to request delivery");
|
|
@@ -6641,7 +6640,7 @@ function Tu(e) {
|
|
|
6641
6640
|
return await i.tallies.push(e, t);
|
|
6642
6641
|
}
|
|
6643
6642
|
async function C() {
|
|
6644
|
-
return !await
|
|
6643
|
+
return !await hr(!1) && !await mr() ? null : await c.url("/profile").get().json();
|
|
6645
6644
|
}
|
|
6646
6645
|
async function w(e) {
|
|
6647
6646
|
let t = await c.url("/profile").patch(e).res();
|
|
@@ -6654,14 +6653,14 @@ function Tu(e) {
|
|
|
6654
6653
|
return (await c.url("/profile/unlink-spotify").post().res()).ok;
|
|
6655
6654
|
}
|
|
6656
6655
|
async function D(t) {
|
|
6657
|
-
let n = await
|
|
6656
|
+
let n = await hr(!1);
|
|
6658
6657
|
if (n) {
|
|
6659
6658
|
let r = new URL(`${Hi("access-sync", e.environment)}/spotify/sesamy-callback`);
|
|
6660
6659
|
r.searchParams.set("access_token", n), r.searchParams.set("state", t), window.location.href = r.toString();
|
|
6661
6660
|
return;
|
|
6662
6661
|
}
|
|
6663
6662
|
let r = gr();
|
|
6664
|
-
if (r !== null && await
|
|
6663
|
+
if (r !== null && await mr()) {
|
|
6665
6664
|
let e = new URL(`${r}/auth/spotify-link`, window.location.origin);
|
|
6666
6665
|
e.searchParams.set("sku", t), window.location.href = e.toString();
|
|
6667
6666
|
return;
|
|
@@ -6680,7 +6679,7 @@ function Tu(e) {
|
|
|
6680
6679
|
return n;
|
|
6681
6680
|
}
|
|
6682
6681
|
async function A(t) {
|
|
6683
|
-
let n = await
|
|
6682
|
+
let n = await hr(!1, !0), r, i = t.language || Yn(), a = xa();
|
|
6684
6683
|
switch (t.target) {
|
|
6685
6684
|
case "account":
|
|
6686
6685
|
r = new URL(`${Hi("account", e.environment)}/${encodeURIComponent(t.language || i)}/subscriptions/${encodeURIComponent(e.vendorId || e.clientId)}${t.contractId ? `/${encodeURIComponent(t.contractId)}` : ""}`), r.searchParams.set("sesamy-redirect-url", t.redirectUrl || window.location.href);
|
|
@@ -6705,7 +6704,7 @@ function Tu(e) {
|
|
|
6705
6704
|
return n && (r.hash = `#access_token=${n}`), t.shorten ? k(r.href, t.ttl) : r.href;
|
|
6706
6705
|
}
|
|
6707
6706
|
async function j() {
|
|
6708
|
-
let t = await
|
|
6707
|
+
let t = await hr(!1), n = new URL(`${Hi("account", e.environment)}/subscriptions/${e.vendorId || e.clientId}`);
|
|
6709
6708
|
t && (n.hash = `#access_token=${t}`), window.location.href = n.toString();
|
|
6710
6709
|
}
|
|
6711
6710
|
async function M(e) {
|
|
@@ -7206,7 +7205,7 @@ function Ku(e, t) {
|
|
|
7206
7205
|
return;
|
|
7207
7206
|
}
|
|
7208
7207
|
n.init(e, {
|
|
7209
|
-
getToken:
|
|
7208
|
+
getToken: hr,
|
|
7210
7209
|
apiEndpoint: t
|
|
7211
7210
|
}), q("[capsule] DcaClient initialized"), window.addEventListener(J.AUTH_INITIALIZED, () => {
|
|
7212
7211
|
Ju();
|
|
@@ -7410,9 +7409,9 @@ async function od(e) {
|
|
|
7410
7409
|
} catch (e) {
|
|
7411
7410
|
t.push(`SessionStorage collection failed: ${e.message}`);
|
|
7412
7411
|
}
|
|
7413
|
-
if (await
|
|
7412
|
+
if (await mr()) {
|
|
7414
7413
|
try {
|
|
7415
|
-
let e = await
|
|
7414
|
+
let e = await hr(!1);
|
|
7416
7415
|
if (e) {
|
|
7417
7416
|
let t = e.split(".");
|
|
7418
7417
|
t.length >= 2 && (n.userId = JSON.parse(atob(t[1])).sub);
|
|
@@ -7450,8 +7449,8 @@ async function od(e) {
|
|
|
7450
7449
|
}
|
|
7451
7450
|
async function sd(e, t, n) {
|
|
7452
7451
|
let r = `${Hi("api2", t)}/diagnostics`, i = { "Content-Type": "application/json" };
|
|
7453
|
-
if (await
|
|
7454
|
-
let e = await
|
|
7452
|
+
if (await mr()) try {
|
|
7453
|
+
let e = await hr(!1);
|
|
7455
7454
|
e && (i.Authorization = `Bearer ${e}`);
|
|
7456
7455
|
} catch {}
|
|
7457
7456
|
if (!i.Authorization && n) {
|
|
@@ -7542,8 +7541,8 @@ function hd(e) {
|
|
|
7542
7541
|
},
|
|
7543
7542
|
auth: {
|
|
7544
7543
|
getUser: d,
|
|
7545
|
-
getTokenSilently:
|
|
7546
|
-
isAuthenticated:
|
|
7544
|
+
getTokenSilently: hr,
|
|
7545
|
+
isAuthenticated: mr,
|
|
7547
7546
|
loginWithRedirect: vr,
|
|
7548
7547
|
loginWithPopup: yr,
|
|
7549
7548
|
login: _r,
|
|
@@ -7754,7 +7753,7 @@ async function Sd(e, t) {
|
|
|
7754
7753
|
//#region src/services/transform/index.ts
|
|
7755
7754
|
async function Cd({ enabled: e = !1, rules: t }) {
|
|
7756
7755
|
e && tl(async () => {
|
|
7757
|
-
let e = await
|
|
7756
|
+
let e = await mr(), n = window.location.href;
|
|
7758
7757
|
for (let r of t) {
|
|
7759
7758
|
let t = document.querySelectorAll(r.selector);
|
|
7760
7759
|
if (!(r.path && !new RegExp(r.path).test(n))) for (let n of t) {
|
|
@@ -7913,10 +7912,12 @@ var Fd = "sesamy-user";
|
|
|
7913
7912
|
async function Id() {
|
|
7914
7913
|
let e = new URLSearchParams(window.location.search).get(Fd)?.toLowerCase();
|
|
7915
7914
|
if (!e) return;
|
|
7916
|
-
let t =
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7915
|
+
let t = new URL(window.location.href);
|
|
7916
|
+
if (t.searchParams.delete(Fd), window.history.replaceState(null, "", t), await mr()) {
|
|
7917
|
+
q("sesamy-user hint ignored — already authenticated");
|
|
7918
|
+
return;
|
|
7919
|
+
}
|
|
7920
|
+
q(`sesamy-user hint — not authenticated, starting login for ${e}`), fi(), vr({ authorizationParams: { login_hint: e } });
|
|
7920
7921
|
}
|
|
7921
7922
|
zn(), Gn(), Vn();
|
|
7922
7923
|
var Ld = "sesamy-purchase";
|
|
@@ -7933,7 +7934,7 @@ var zd = "sesamy-login", Bd = "sesamy_login";
|
|
|
7933
7934
|
async function Vd() {
|
|
7934
7935
|
let e = new URLSearchParams(window.location.search);
|
|
7935
7936
|
if (!(e.get(zd) || e.get(Bd))) return;
|
|
7936
|
-
await
|
|
7937
|
+
await mr() || vr();
|
|
7937
7938
|
let t = new URL(window.location.href);
|
|
7938
7939
|
t.searchParams.delete(zd), window.history.replaceState(null, "", t);
|
|
7939
7940
|
}
|
|
@@ -8049,7 +8050,7 @@ async function Qd(e, t, n) {
|
|
|
8049
8050
|
clientId: e.clientId,
|
|
8050
8051
|
environment: e.environment,
|
|
8051
8052
|
...e.analytics
|
|
8052
|
-
}), n && qn(n), await
|
|
8053
|
+
}), n && qn(n), await pr({
|
|
8053
8054
|
clientId: e.clientId,
|
|
8054
8055
|
vendorId: e.vendorId || e.clientId,
|
|
8055
8056
|
organization: e.organization,
|