@lumiapassport/ui-kit 1.14.14 → 1.14.15

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.14.14</title>
18
+ <title>Lumia Passport Secure Wallet - iframe version 1.14.15</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -1476,6 +1476,13 @@ var AuthorizationManager = class {
1476
1476
  this.metadataCache = /* @__PURE__ */ new Map();
1477
1477
  console.log("[iframe][Auth] Initialized");
1478
1478
  }
1479
+ /**
1480
+ * Check if project is a trusted authorized app (auto-skip auth dialog)
1481
+ */
1482
+ async isTrustedAuthorizedApp(projectId) {
1483
+ const metadata = await this.fetchProjectMetadata(projectId);
1484
+ return metadata?.trustedAuthorizedApp === true;
1485
+ }
1479
1486
  /**
1480
1487
  * Fetch project metadata from public API (with caching)
1481
1488
  */
@@ -4221,7 +4228,7 @@ var SigningManager = class extends TokenRefreshApiClient {
4221
4228
  };
4222
4229
 
4223
4230
  // src/iframe/main.ts
4224
- var IFRAME_VERSION = "1.14.14";
4231
+ var IFRAME_VERSION = "1.14.15";
4225
4232
  var IframeWallet = class {
4226
4233
  constructor() {
4227
4234
  console.log("=".repeat(60));
@@ -4355,20 +4362,27 @@ var IframeWallet = class {
4355
4362
  console.log(`[iframe] AUTHENTICATE: userId=${userId}, projectId=${projectId}`);
4356
4363
  const isAuthorized = await this.authManager.checkAuthorization(userId, projectId);
4357
4364
  if (!isAuthorized) {
4358
- console.log(`[iframe] Authorization needed for project: ${projectId}`);
4359
- const projectInfo = {
4360
- id: projectId,
4361
- name: "Application",
4362
- logoUrl: "",
4363
- website: origin,
4364
- domains: [origin]
4365
- };
4366
- const consent = await this.authManager.requestAuthorization(projectInfo, origin, { avatar, displayName });
4367
- if (!consent) {
4368
- throw new Error("User denied authorization");
4365
+ const isTrustedApp = await this.authManager.isTrustedAuthorizedApp(projectId);
4366
+ if (isTrustedApp) {
4367
+ console.log(`[iframe] Project ${projectId} is a trusted authorized app, auto-authorizing`);
4368
+ await this.authManager.storeAuthorization(userId, projectId, origin);
4369
+ console.log(`[iframe] \u2705 Auto-authorization granted for trusted app: ${userId} -> ${projectId}`);
4370
+ } else {
4371
+ console.log(`[iframe] Authorization needed for project: ${projectId}`);
4372
+ const projectInfo = {
4373
+ id: projectId,
4374
+ name: "Application",
4375
+ logoUrl: "",
4376
+ website: origin,
4377
+ domains: [origin]
4378
+ };
4379
+ const consent = await this.authManager.requestAuthorization(projectInfo, origin, { avatar, displayName });
4380
+ if (!consent) {
4381
+ throw new Error("User denied authorization");
4382
+ }
4383
+ await this.authManager.storeAuthorization(userId, projectId, origin);
4384
+ console.log(`[iframe] \u2705 Authorization granted: ${userId} -> ${projectId}`);
4369
4385
  }
4370
- await this.authManager.storeAuthorization(userId, projectId, origin);
4371
- console.log(`[iframe] \u2705 Authorization granted: ${userId} -> ${projectId}`);
4372
4386
  }
4373
4387
  const address = this.storage.getOwnerAddress(userId);
4374
4388
  this.messenger.sendResponse(