@lumiapassport/ui-kit 1.16.8 → 1.16.9

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.
@@ -15,7 +15,7 @@
15
15
  <meta http-equiv="X-Content-Type-Options" content="nosniff" />
16
16
  <meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
17
17
 
18
- <title>Lumia Passport Secure Wallet - iframe version 1.16.8</title>
18
+ <title>Lumia Passport Secure Wallet - iframe version 1.16.9</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -4411,7 +4411,7 @@ var SigningManager = class extends TokenRefreshApiClient {
4411
4411
  };
4412
4412
 
4413
4413
  // src/iframe/main.ts
4414
- var IFRAME_VERSION = "1.16.8";
4414
+ var IFRAME_VERSION = "1.16.9";
4415
4415
  var IframeWallet = class {
4416
4416
  constructor() {
4417
4417
  console.log("=".repeat(60));
package/dist/index.cjs CHANGED
@@ -3423,7 +3423,7 @@ var init_iframe_manager = __esm({
3423
3423
  } else if (event.data.type === "X_AUTH_CANCELLED" && eventProvider === "x" && providerKey === "x") {
3424
3424
  this.log("[IframeManager] X auth cancelled by user");
3425
3425
  pendingCancellation = true;
3426
- this.verifyXAuthSession().then((verification) => {
3426
+ this.verifyAuthSession({ provider: "x" }).then((verification) => {
3427
3427
  const sessionId = verification.sessionId || null;
3428
3428
  const providers = verification.providers || [];
3429
3429
  const isConnectedNow = providers.includes("x");
@@ -3517,10 +3517,12 @@ var init_iframe_manager = __esm({
3517
3517
  });
3518
3518
  }
3519
3519
  /**
3520
- * Fallback verification for X OAuth cancellations.
3521
- * Attempts to detect if the backend session was still established.
3520
+ * Verify current auth session with the backend.
3521
+ * Can optionally track session state for a specific provider.
3522
+ * @param options.silent - If true, suppress logging
3523
+ * @param options.provider - Optional provider key to track session state for (e.g., 'x', 'telegram')
3522
3524
  */
3523
- async verifyXAuthSession(options = {}) {
3525
+ async verifyAuthSession(options = {}) {
3524
3526
  if (typeof window === "undefined" || typeof fetch === "undefined") {
3525
3527
  return { success: false };
3526
3528
  }
@@ -3529,7 +3531,7 @@ var init_iframe_manager = __esm({
3529
3531
  const { tssUrl } = getServiceUrls2();
3530
3532
  const projectId = typeof window !== "undefined" ? window.__LUMIA_PROJECT_ID__ : void 0;
3531
3533
  if (!tssUrl) {
3532
- this.log("[IframeManager] X auth fallback aborted: missing TSS URL");
3534
+ this.log("[IframeManager] Session verify aborted: missing TSS URL");
3533
3535
  return { success: false };
3534
3536
  }
3535
3537
  const verifyUrl = new URL(`${tssUrl}/api/auth/verify`);
@@ -3553,7 +3555,7 @@ var init_iframe_manager = __esm({
3553
3555
  credentials: "include"
3554
3556
  });
3555
3557
  if (response.status === 401) {
3556
- this.log("[IframeManager] X auth verify got 401, attempting token refresh...");
3558
+ this.log("[IframeManager] Session verify got 401, attempting token refresh...");
3557
3559
  const refreshSuccess = await jwtTokenManager4.refreshAccessToken();
3558
3560
  if (refreshSuccess) {
3559
3561
  const newAccessToken = jwtTokenManager4.getAccessToken();
@@ -3569,23 +3571,27 @@ var init_iframe_manager = __esm({
3569
3571
  }
3570
3572
  }
3571
3573
  if (!response.ok) {
3572
- this.log("[IframeManager] X auth fallback verify returned status:", response.status);
3573
- this.recordProviderSession("x", null);
3574
- this.recordProviderConnection("x", false);
3574
+ this.log("[IframeManager] Session verify returned status:", response.status);
3575
+ if (options.provider) {
3576
+ this.recordProviderSession(options.provider, null);
3577
+ this.recordProviderConnection(options.provider, false);
3578
+ }
3575
3579
  return { success: false };
3576
3580
  }
3577
3581
  let userData = void 0;
3578
3582
  try {
3579
3583
  userData = await response.json();
3580
3584
  } catch (jsonError) {
3581
- this.log("[IframeManager] X auth fallback verify JSON parse failed:", jsonError);
3585
+ this.log("[IframeManager] Session verify JSON parse failed:", jsonError);
3582
3586
  }
3583
3587
  const sessionId = this.extractSessionId(userData);
3584
3588
  const providers = this.getProvidersList(userData);
3585
- this.recordProviderSession("x", sessionId);
3586
- this.recordProviderConnection("x", providers.includes("x"));
3589
+ if (options.provider) {
3590
+ this.recordProviderSession(options.provider, sessionId);
3591
+ this.recordProviderConnection(options.provider, providers.includes(options.provider));
3592
+ }
3587
3593
  if (!options.silent) {
3588
- this.log("[IframeManager] X auth verify result:", {
3594
+ this.log("[IframeManager] Session verify result:", {
3589
3595
  sessionId,
3590
3596
  providers
3591
3597
  });
@@ -3597,9 +3603,11 @@ var init_iframe_manager = __esm({
3597
3603
  providers
3598
3604
  };
3599
3605
  } catch (error) {
3600
- this.log("[IframeManager] X auth fallback verify threw error:", error);
3601
- this.recordProviderSession("x", null);
3602
- this.recordProviderConnection("x", false);
3606
+ this.log("[IframeManager] Session verify error:", error);
3607
+ if (options.provider) {
3608
+ this.recordProviderSession(options.provider, null);
3609
+ this.recordProviderConnection(options.provider, false);
3610
+ }
3603
3611
  return { success: false };
3604
3612
  }
3605
3613
  }
@@ -3608,7 +3616,7 @@ var init_iframe_manager = __esm({
3608
3616
  */
3609
3617
  async primeProviderSessions() {
3610
3618
  try {
3611
- await this.verifyXAuthSession({ silent: true });
3619
+ await this.verifyAuthSession({ silent: true });
3612
3620
  } catch (error) {
3613
3621
  this.log("[IframeManager] Prime provider sessions failed:", error);
3614
3622
  }
@@ -5827,7 +5835,7 @@ var init_package = __esm({
5827
5835
  "package.json"() {
5828
5836
  package_default = {
5829
5837
  name: "@lumiapassport/ui-kit",
5830
- version: "1.16.8",
5838
+ version: "1.16.9",
5831
5839
  description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
5832
5840
  type: "module",
5833
5841
  main: "./dist/index.cjs",