@lumiapassport/ui-kit 1.4.9 → 1.4.12
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -74
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +1 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -53,14 +53,12 @@ function getServiceUrls() {
|
|
|
53
53
|
tssRequireWasm: globalOverride.tssRequireWasm ?? buildRequireWasm ?? config.services.tssRequireWasm ?? false,
|
|
54
54
|
tssWasmDebug: globalOverride.tssWasmDebug ?? buildWasmDebug ?? config.services.tssWasmDebug ?? false
|
|
55
55
|
};
|
|
56
|
-
console.debug("[getServiceUrls] globalOverride:", globalOverride, "buildTss:", buildTss, "result:", result);
|
|
57
56
|
return result;
|
|
58
57
|
}
|
|
59
58
|
function getIframeUrl() {
|
|
60
59
|
const config = defaultLumiaPassportConfig;
|
|
61
60
|
const buildIframeUrl = "https://auth.lumiapassport.com";
|
|
62
61
|
const iframeUrl = buildIframeUrl || config.services.iframeUrl || "https://auth.lumiapassport.com";
|
|
63
|
-
console.log("[getIframeUrl] Using iframe URL:", iframeUrl);
|
|
64
62
|
return iframeUrl;
|
|
65
63
|
}
|
|
66
64
|
var import_jsx_runtime, GoogleIcon, TelegramIcon, TwitterIcon, DiscordIcon, defaultLumiaPassportConfig;
|
|
@@ -2396,10 +2394,8 @@ var init_iframe_manager = __esm({
|
|
|
2396
2394
|
*/
|
|
2397
2395
|
async initialize() {
|
|
2398
2396
|
if (this.iframe) {
|
|
2399
|
-
this.log("[IframeManager] Already initialized");
|
|
2400
2397
|
return this.readyPromise;
|
|
2401
2398
|
}
|
|
2402
|
-
this.log("[IframeManager] Initializing iframe...");
|
|
2403
2399
|
this.iframe = document.createElement("iframe");
|
|
2404
2400
|
this.iframe.src = this.iframeUrl;
|
|
2405
2401
|
this.iframe.id = "lumia-passport-iframe";
|
|
@@ -2431,13 +2427,11 @@ var init_iframe_manager = __esm({
|
|
|
2431
2427
|
* Authenticate SDK with iframe to establish session
|
|
2432
2428
|
*/
|
|
2433
2429
|
async authenticateSDK() {
|
|
2434
|
-
this.log("[IframeManager] Authenticating SDK...");
|
|
2435
2430
|
const response = await this.sendMessage("SDK_AUTH", {
|
|
2436
2431
|
projectId: this.projectId
|
|
2437
2432
|
});
|
|
2438
2433
|
if (response.type === "LUMIA_PASSPORT_SDK_AUTH_SUCCESS") {
|
|
2439
2434
|
this.sessionToken = response.sessionToken;
|
|
2440
|
-
this.log("[IframeManager] \u2705 SDK authenticated, session token received");
|
|
2441
2435
|
} else {
|
|
2442
2436
|
throw new Error("SDK authentication failed");
|
|
2443
2437
|
}
|
|
@@ -2522,13 +2516,11 @@ var init_iframe_manager = __esm({
|
|
|
2522
2516
|
* Handle token refresh request from iframe
|
|
2523
2517
|
*/
|
|
2524
2518
|
async handleTokenRefreshRequest(message) {
|
|
2525
|
-
this.log("[IframeManager] Handling token refresh request...");
|
|
2526
2519
|
try {
|
|
2527
2520
|
const { jwtTokenManager: jwtTokenManager3 } = await Promise.resolve().then(() => (init_auth(), auth_exports));
|
|
2528
2521
|
const refreshSuccess = await jwtTokenManager3.refreshAccessToken();
|
|
2529
2522
|
if (refreshSuccess) {
|
|
2530
2523
|
const newAccessToken = jwtTokenManager3.getAccessToken();
|
|
2531
|
-
this.log("[IframeManager] \u2705 Token refreshed successfully");
|
|
2532
2524
|
if (this.iframe && this.iframe.contentWindow) {
|
|
2533
2525
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
2534
2526
|
this.iframe.contentWindow.postMessage(
|
|
@@ -2540,10 +2532,8 @@ var init_iframe_manager = __esm({
|
|
|
2540
2532
|
},
|
|
2541
2533
|
iframeOrigin
|
|
2542
2534
|
);
|
|
2543
|
-
this.log("[IframeManager] \u{1F4E4} Sent new token to iframe");
|
|
2544
2535
|
}
|
|
2545
2536
|
} else {
|
|
2546
|
-
this.log("[IframeManager] \u274C Token refresh failed");
|
|
2547
2537
|
if (this.iframe && this.iframe.contentWindow) {
|
|
2548
2538
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
2549
2539
|
this.iframe.contentWindow.postMessage(
|
|
@@ -2558,7 +2548,6 @@ var init_iframe_manager = __esm({
|
|
|
2558
2548
|
}
|
|
2559
2549
|
}
|
|
2560
2550
|
} catch (error) {
|
|
2561
|
-
this.log("[IframeManager] \u274C Error during token refresh:", error);
|
|
2562
2551
|
if (this.iframe && this.iframe.contentWindow) {
|
|
2563
2552
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
2564
2553
|
this.iframe.contentWindow.postMessage(
|
|
@@ -2662,7 +2651,6 @@ var init_iframe_manager = __esm({
|
|
|
2662
2651
|
showIframe() {
|
|
2663
2652
|
if (this.iframe) {
|
|
2664
2653
|
this.iframe.style.display = "block";
|
|
2665
|
-
this.log("[IframeManager] Iframe shown");
|
|
2666
2654
|
}
|
|
2667
2655
|
}
|
|
2668
2656
|
/**
|
|
@@ -2671,7 +2659,6 @@ var init_iframe_manager = __esm({
|
|
|
2671
2659
|
hideIframe() {
|
|
2672
2660
|
if (this.iframe) {
|
|
2673
2661
|
this.iframe.style.display = "none";
|
|
2674
|
-
this.log("[IframeManager] Iframe hidden");
|
|
2675
2662
|
}
|
|
2676
2663
|
}
|
|
2677
2664
|
// ========================================
|
|
@@ -2681,7 +2668,6 @@ var init_iframe_manager = __esm({
|
|
|
2681
2668
|
* Authenticate user with application
|
|
2682
2669
|
*/
|
|
2683
2670
|
async authenticate(userId) {
|
|
2684
|
-
this.log("[IframeManager] Authenticating user:", userId);
|
|
2685
2671
|
const response = await this.sendMessage("AUTHENTICATE", {
|
|
2686
2672
|
userId,
|
|
2687
2673
|
projectId: this.projectId
|
|
@@ -2698,7 +2684,6 @@ var init_iframe_manager = __esm({
|
|
|
2698
2684
|
* Start DKG (Distributed Key Generation)
|
|
2699
2685
|
*/
|
|
2700
2686
|
async startDKG(userId, accessToken) {
|
|
2701
|
-
this.log("[IframeManager] Starting DKG for user:", userId);
|
|
2702
2687
|
const response = await this.sendMessage("START_DKG", {
|
|
2703
2688
|
userId,
|
|
2704
2689
|
projectId: this.projectId,
|
|
@@ -2714,7 +2699,6 @@ var init_iframe_manager = __esm({
|
|
|
2714
2699
|
* Sign transaction
|
|
2715
2700
|
*/
|
|
2716
2701
|
async signTransaction(userId, transaction, accessToken) {
|
|
2717
|
-
this.log("[IframeManager] Signing transaction for user:", userId);
|
|
2718
2702
|
const response = await this.sendMessage("SIGN_TRANSACTION", {
|
|
2719
2703
|
userId,
|
|
2720
2704
|
projectId: this.projectId,
|
|
@@ -2731,7 +2715,6 @@ var init_iframe_manager = __esm({
|
|
|
2731
2715
|
* Get user's wallet address
|
|
2732
2716
|
*/
|
|
2733
2717
|
async getAddress(userId) {
|
|
2734
|
-
this.log("[IframeManager] Getting address for user:", userId);
|
|
2735
2718
|
const response = await this.sendMessage("GET_ADDRESS", {
|
|
2736
2719
|
userId
|
|
2737
2720
|
});
|
|
@@ -2744,7 +2727,6 @@ var init_iframe_manager = __esm({
|
|
|
2744
2727
|
* Check if user has a keyshare
|
|
2745
2728
|
*/
|
|
2746
2729
|
async checkKeyshare(userId) {
|
|
2747
|
-
this.log("[IframeManager] Checking keyshare for user:", userId);
|
|
2748
2730
|
const response = await this.sendMessage("CHECK_KEYSHARE", {
|
|
2749
2731
|
userId
|
|
2750
2732
|
});
|
|
@@ -2760,7 +2742,6 @@ var init_iframe_manager = __esm({
|
|
|
2760
2742
|
* Get trusted apps for user
|
|
2761
2743
|
*/
|
|
2762
2744
|
async getTrustedApps(userId) {
|
|
2763
|
-
this.log("[IframeManager] Getting trusted apps for user:", userId);
|
|
2764
2745
|
const response = await this.sendMessage("GET_TRUSTED_APPS", {
|
|
2765
2746
|
userId
|
|
2766
2747
|
});
|
|
@@ -2773,7 +2754,6 @@ var init_iframe_manager = __esm({
|
|
|
2773
2754
|
* Remove app from trusted list
|
|
2774
2755
|
*/
|
|
2775
2756
|
async removeTrustedApp(userId, projectId, origin) {
|
|
2776
|
-
this.log("[IframeManager] Removing trusted app:", { userId, projectId, origin });
|
|
2777
2757
|
const response = await this.sendMessage("REMOVE_TRUSTED_APP", {
|
|
2778
2758
|
userId,
|
|
2779
2759
|
projectId,
|
|
@@ -2788,7 +2768,6 @@ var init_iframe_manager = __esm({
|
|
|
2788
2768
|
* Create backup of keyshare
|
|
2789
2769
|
*/
|
|
2790
2770
|
async createBackup(userId, backupRequest, accessToken) {
|
|
2791
|
-
this.log("[IframeManager] Creating backup...");
|
|
2792
2771
|
const response = await this.sendMessage("CREATE_BACKUP", {
|
|
2793
2772
|
userId,
|
|
2794
2773
|
backupRequest,
|
|
@@ -2804,7 +2783,6 @@ var init_iframe_manager = __esm({
|
|
|
2804
2783
|
* Restore keyshare from server backup
|
|
2805
2784
|
*/
|
|
2806
2785
|
async restoreFromServer(userId, password, accessToken) {
|
|
2807
|
-
this.log("[IframeManager] Restoring backup from server...");
|
|
2808
2786
|
const response = await this.sendMessage("RESTORE_BACKUP", {
|
|
2809
2787
|
userId,
|
|
2810
2788
|
password,
|
|
@@ -2821,7 +2799,6 @@ var init_iframe_manager = __esm({
|
|
|
2821
2799
|
* Returns encrypted data that parent can upload/download
|
|
2822
2800
|
*/
|
|
2823
2801
|
async encryptBackupData(userId, password) {
|
|
2824
|
-
this.log("[IframeManager] Encrypting backup data...");
|
|
2825
2802
|
const response = await this.sendMessage("ENCRYPT_BACKUP_DATA", {
|
|
2826
2803
|
userId,
|
|
2827
2804
|
password
|
|
@@ -2835,7 +2812,6 @@ var init_iframe_manager = __esm({
|
|
|
2835
2812
|
* Restore keyshare from local file backup
|
|
2836
2813
|
*/
|
|
2837
2814
|
async restoreFromLocalFile(userId, fileContent, password) {
|
|
2838
|
-
this.log("[IframeManager] Restoring backup from local file...");
|
|
2839
2815
|
const response = await this.sendMessage("RESTORE_FROM_FILE", {
|
|
2840
2816
|
userId,
|
|
2841
2817
|
fileContent,
|
|
@@ -2850,7 +2826,6 @@ var init_iframe_manager = __esm({
|
|
|
2850
2826
|
* Get backup status for user
|
|
2851
2827
|
*/
|
|
2852
2828
|
async getBackupStatus(userId) {
|
|
2853
|
-
this.log("[IframeManager] Getting backup status...");
|
|
2854
2829
|
const response = await this.sendMessage("GET_BACKUP_STATUS", {
|
|
2855
2830
|
userId
|
|
2856
2831
|
});
|
|
@@ -2863,7 +2838,6 @@ var init_iframe_manager = __esm({
|
|
|
2863
2838
|
* Get available cloud providers
|
|
2864
2839
|
*/
|
|
2865
2840
|
async getCloudProviders() {
|
|
2866
|
-
this.log("[IframeManager] Getting cloud providers...");
|
|
2867
2841
|
const response = await this.sendMessage("GET_CLOUD_PROVIDERS", {});
|
|
2868
2842
|
if (response.type === "LUMIA_PASSPORT_CLOUD_PROVIDERS") {
|
|
2869
2843
|
return response.providers;
|
|
@@ -8538,7 +8512,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
8538
8512
|
// package.json
|
|
8539
8513
|
var package_default = {
|
|
8540
8514
|
name: "@lumiapassport/ui-kit",
|
|
8541
|
-
version: "1.4.
|
|
8515
|
+
version: "1.4.12",
|
|
8542
8516
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
8543
8517
|
type: "module",
|
|
8544
8518
|
main: "./dist/index.cjs",
|