@cedros/login-react 0.0.36 → 0.0.38
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/{AuthenticationSettings-DIVk0OP8.js → AuthenticationSettings-BWfMzQ30.js} +24 -24
- package/dist/{AuthenticationSettings-DIVk0OP8.js.map → AuthenticationSettings-BWfMzQ30.js.map} +1 -1
- package/dist/{AuthenticationSettings-C-aYDXNH.cjs → AuthenticationSettings-CaNdnqL2.cjs} +1 -1
- package/dist/{AuthenticationSettings-C-aYDXNH.cjs.map → AuthenticationSettings-CaNdnqL2.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-CoTic-d_.cjs → AuthenticationSettings-REAsemKP.cjs} +1 -1
- package/dist/{AuthenticationSettings-CoTic-d_.cjs.map → AuthenticationSettings-REAsemKP.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-CsPbxwP7.js → AuthenticationSettings-pR8sUc8u.js} +1 -1
- package/dist/{AuthenticationSettings-CsPbxwP7.js.map → AuthenticationSettings-pR8sUc8u.js.map} +1 -1
- package/dist/{AutosaveStatus-f-jw25Ay.js → AutosaveStatus-Bgts5i6l.js} +83 -72
- package/dist/AutosaveStatus-Bgts5i6l.js.map +1 -0
- package/dist/{AutosaveStatus-DGNI4lXn.cjs → AutosaveStatus-DNK2vjyX.cjs} +1 -1
- package/dist/AutosaveStatus-DNK2vjyX.cjs.map +1 -0
- package/dist/{CreditSystemSettings-BNkvsgsk.cjs → CreditSystemSettings-BP-DMr-u.cjs} +1 -1
- package/dist/{CreditSystemSettings-BNkvsgsk.cjs.map → CreditSystemSettings-BP-DMr-u.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-C6ed3yp7.js → CreditSystemSettings-CLKgkXHi.js} +1 -1
- package/dist/{CreditSystemSettings-C6ed3yp7.js.map → CreditSystemSettings-CLKgkXHi.js.map} +1 -1
- package/dist/{CreditSystemSettings-uinhzoha.js → CreditSystemSettings-DBo-z1ti.js} +1 -1
- package/dist/{CreditSystemSettings-uinhzoha.js.map → CreditSystemSettings-DBo-z1ti.js.map} +1 -1
- package/dist/{CreditSystemSettings-DM9ep1TF.cjs → CreditSystemSettings-OHes0bEe.cjs} +1 -1
- package/dist/{CreditSystemSettings-DM9ep1TF.cjs.map → CreditSystemSettings-OHes0bEe.cjs.map} +1 -1
- package/dist/{EmailRegisterForm-CCEuQA-w.js → EmailRegisterForm-BiisUR7P.js} +1 -1
- package/dist/{EmailRegisterForm-CCEuQA-w.js.map → EmailRegisterForm-BiisUR7P.js.map} +1 -1
- package/dist/{EmailRegisterForm-B_TiJkD6.cjs → EmailRegisterForm-CBzHZxvg.cjs} +1 -1
- package/dist/{EmailRegisterForm-B_TiJkD6.cjs.map → EmailRegisterForm-CBzHZxvg.cjs.map} +1 -1
- package/dist/{EmailSettings-BKuXy8sc.js → EmailSettings-JKyF5uqz.js} +1 -1
- package/dist/{EmailSettings-BKuXy8sc.js.map → EmailSettings-JKyF5uqz.js.map} +1 -1
- package/dist/{EmailSettings-BAuQtEfM.js → EmailSettings-j1TW9Nph.js} +1 -1
- package/dist/{EmailSettings-BAuQtEfM.js.map → EmailSettings-j1TW9Nph.js.map} +1 -1
- package/dist/{EmailSettings-BF5EiPl9.cjs → EmailSettings-kqzTquHb.cjs} +1 -1
- package/dist/{EmailSettings-BF5EiPl9.cjs.map → EmailSettings-kqzTquHb.cjs.map} +1 -1
- package/dist/{EmailSettings-BC0f1PCI.cjs → EmailSettings-lrl43m3p.cjs} +1 -1
- package/dist/{EmailSettings-BC0f1PCI.cjs.map → EmailSettings-lrl43m3p.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BRjt2PAj.cjs → EmbeddedWalletSettings-1ERxP6--.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BRjt2PAj.cjs.map → EmbeddedWalletSettings-1ERxP6--.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-Dmi-EQ7W.js → EmbeddedWalletSettings-Bln1PHH4.js} +1 -1
- package/dist/{EmbeddedWalletSettings-Dmi-EQ7W.js.map → EmbeddedWalletSettings-Bln1PHH4.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-C27X9He2.js → EmbeddedWalletSettings-_45K-0PV.js} +1 -1
- package/dist/{EmbeddedWalletSettings-C27X9He2.js.map → EmbeddedWalletSettings-_45K-0PV.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CJY39UZN.cjs → EmbeddedWalletSettings-tg6BTW4F.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-CJY39UZN.cjs.map → EmbeddedWalletSettings-tg6BTW4F.cjs.map} +1 -1
- package/dist/{GoogleLoginButton-BDCbxoCB.cjs → GoogleLoginButton-JtRViYWS.cjs} +1 -1
- package/dist/GoogleLoginButton-JtRViYWS.cjs.map +1 -0
- package/dist/{GoogleLoginButton-6ip-vudk.js → GoogleLoginButton-qf4A_A3G.js} +6 -6
- package/dist/GoogleLoginButton-qf4A_A3G.js.map +1 -0
- package/dist/{ServerSettings-CZfBdMxG.js → ServerSettings-BGI3YP_z.js} +1 -1
- package/dist/{ServerSettings-CZfBdMxG.js.map → ServerSettings-BGI3YP_z.js.map} +1 -1
- package/dist/{ServerSettings-BT9weFPz.js → ServerSettings-D2sqqBMZ.js} +1 -1
- package/dist/{ServerSettings-BT9weFPz.js.map → ServerSettings-D2sqqBMZ.js.map} +1 -1
- package/dist/{ServerSettings-CKfiLfXi.cjs → ServerSettings-DBc7opXq.cjs} +1 -1
- package/dist/{ServerSettings-CKfiLfXi.cjs.map → ServerSettings-DBc7opXq.cjs.map} +1 -1
- package/dist/{ServerSettings-rHrVN8O8.cjs → ServerSettings-etuaUiXh.cjs} +1 -1
- package/dist/{ServerSettings-rHrVN8O8.cjs.map → ServerSettings-etuaUiXh.cjs.map} +1 -1
- package/dist/{WebhookSettings-ufiGTmbG.js → WebhookSettings-B0_D5YIz.js} +1 -1
- package/dist/{WebhookSettings-ufiGTmbG.js.map → WebhookSettings-B0_D5YIz.js.map} +1 -1
- package/dist/{WebhookSettings-DnLk97Mr.cjs → WebhookSettings-BHgVRCin.cjs} +1 -1
- package/dist/{WebhookSettings-DnLk97Mr.cjs.map → WebhookSettings-BHgVRCin.cjs.map} +1 -1
- package/dist/{WebhookSettings-DXjnq-c7.cjs → WebhookSettings-CD8gptC3.cjs} +1 -1
- package/dist/{WebhookSettings-DXjnq-c7.cjs.map → WebhookSettings-CD8gptC3.cjs.map} +1 -1
- package/dist/{WebhookSettings-Bgld6D_T.js → WebhookSettings-CHe_D4Bd.js} +1 -1
- package/dist/{WebhookSettings-Bgld6D_T.js.map → WebhookSettings-CHe_D4Bd.js.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +3 -2
- package/dist/email-only.js +2 -2
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.d.ts +5 -4
- package/dist/google-only.js +2 -2
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +70 -4
- package/dist/index.js +2427 -2231
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/{plugin-BbExid4E.js → plugin-DD07LDez.js} +1 -1
- package/dist/{plugin-BbExid4E.js.map → plugin-DD07LDez.js.map} +1 -1
- package/dist/{plugin-Xca67fp7.cjs → plugin-DTP_0JDr.cjs} +1 -1
- package/dist/{plugin-Xca67fp7.cjs.map → plugin-DTP_0JDr.cjs.map} +1 -1
- package/dist/{shamir-DBpHm7WN.cjs → shamir-BNuiZ2ry.cjs} +1 -1
- package/dist/{shamir-DBpHm7WN.cjs.map → shamir-BNuiZ2ry.cjs.map} +1 -1
- package/dist/{shamir-R8ddesFt.js → shamir-BbDh58Zo.js} +1 -1
- package/dist/{shamir-R8ddesFt.js.map → shamir-BbDh58Zo.js.map} +1 -1
- package/dist/{silentWalletEnroll-HPvsbd2J.cjs → silentWalletEnroll-B6a-fPgB.cjs} +1 -1
- package/dist/{silentWalletEnroll-HPvsbd2J.cjs.map → silentWalletEnroll-B6a-fPgB.cjs.map} +1 -1
- package/dist/{silentWalletEnroll-Dp1GTeNr.js → silentWalletEnroll-KHso2-HB.js} +2 -2
- package/dist/{silentWalletEnroll-Dp1GTeNr.js.map → silentWalletEnroll-KHso2-HB.js.map} +1 -1
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +3 -2
- package/dist/solana-only.js +1 -1
- package/dist/{useAuth-CVLv2oKA.js → useAuth-CWBApIWg.js} +83 -83
- package/dist/useAuth-CWBApIWg.js.map +1 -0
- package/dist/useAuth-GzGopI4v.cjs +1 -0
- package/dist/useAuth-GzGopI4v.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/AutosaveStatus-DGNI4lXn.cjs.map +0 -1
- package/dist/AutosaveStatus-f-jw25Ay.js.map +0 -1
- package/dist/GoogleLoginButton-6ip-vudk.js.map +0 -1
- package/dist/GoogleLoginButton-BDCbxoCB.cjs.map +0 -1
- package/dist/mockServiceWorker.js +0 -349
- package/dist/useAuth-CVLv2oKA.js.map +0 -1
- package/dist/useAuth-XZaciuLg.cjs +0 -1
- package/dist/useAuth-XZaciuLg.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./useCedrosLogin-DtJorrE7.cjs"),e=require("./useAuth-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./useCedrosLogin-DtJorrE7.cjs"),e=require("./useAuth-GzGopI4v.cjs"),t=require("./shamir-BNuiZ2ry.cjs");async function T(A){const{password:p,serverUrl:h,accessToken:n,timeoutMs:y=3e4}=A,r=[];try{const s=e.generateSeed();r.push(s);const{shareA:a,shareB:o}=t.splitSecret(s);r.push(a,o);const c=e.generateArgon2Salt(),l=await t.argon2DeriveInWorker(p,c,e.DEFAULT_KDF_PARAMS);r.push(l);const i=await e.aesGcmEncryptToBase64(a,e.toEncryptionKey(l)),d=t.getPublicKeyFromSeed(s),u=t.publicKeyToBase58(d),g={solanaPubkey:u,shareAAuthMethod:"password",shareACiphertext:i.ciphertext,shareANonce:i.nonce,shareB:e.uint8ArrayToBase64(o),shareAKdfSalt:e.uint8ArrayToBase64(c),shareAKdfParams:e.DEFAULT_KDF_PARAMS};return await new S.ApiClient({baseUrl:h,timeoutMs:y,getAccessToken:n?()=>n:void 0}).post("/wallet/enroll",g),{success:!0,solanaPubkey:u}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Wallet enrollment failed"}}finally{e.wipeAll(...r)}}exports.silentWalletEnroll=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"silentWalletEnroll-
|
|
1
|
+
{"version":3,"file":"silentWalletEnroll-B6a-fPgB.cjs","sources":["../src/utils/silentWalletEnroll.ts"],"sourcesContent":["/**\n * Silent wallet enrollment utility\n *\n * Performs wallet enrollment in the background without UI interaction.\n * Used for auto-enrolling wallets during registration.\n *\n * Security: Uses the same Shamir Secret Sharing scheme as manual enrollment.\n * The recovery phrase is not shown - user can retrieve it later if needed.\n */\n\nimport {\n generateSeed,\n generateArgon2Salt,\n splitSecret,\n argon2DeriveInWorker,\n aesGcmEncryptToBase64,\n uint8ArrayToBase64,\n getPublicKeyFromSeed,\n publicKeyToBase58,\n wipeAll,\n toEncryptionKey,\n DEFAULT_KDF_PARAMS,\n} from '../crypto';\nimport { ApiClient } from './apiClient';\nimport type { WalletEnrollRequest } from '../types/wallet';\n\nexport interface SilentEnrollOptions {\n /** User's password for Share A encryption */\n password: string;\n /** Server base URL */\n serverUrl: string;\n /** Access token for authentication (optional if using cookies) */\n accessToken?: string;\n /** Request timeout in ms */\n timeoutMs?: number;\n}\n\nexport interface SilentEnrollResult {\n success: boolean;\n solanaPubkey?: string;\n error?: string;\n}\n\n/**\n * Silently enroll a wallet for a user\n *\n * This function performs the complete wallet enrollment process:\n * 1. Generate 32-byte seed\n * 2. Split into 3 Shamir shares (threshold 2)\n * 3. Encrypt Share A with password-derived key (Argon2id)\n * 4. Derive Solana public key from seed\n * 5. Upload encrypted Share A + plaintext Share B to server\n *\n * The recovery phrase (Share C) is not returned - user can recover it\n * later through the wallet recovery flow if needed.\n *\n * @param options - Enrollment options\n * @returns Result with success status and Solana public key\n */\nexport async function silentWalletEnroll(\n options: SilentEnrollOptions\n): Promise<SilentEnrollResult> {\n const { password, serverUrl, accessToken, timeoutMs = 30000 } = options;\n\n // Track sensitive data for cleanup\n const sensitiveData: Uint8Array[] = [];\n\n try {\n // Step 1: Generate seed\n const seed = generateSeed();\n sensitiveData.push(seed);\n\n // Step 2: Split into shares\n const { shareA, shareB } = splitSecret(seed);\n sensitiveData.push(shareA, shareB);\n\n // Step 3: Derive encryption key from password\n const salt = generateArgon2Salt();\n const key = await argon2DeriveInWorker(password, salt, DEFAULT_KDF_PARAMS);\n sensitiveData.push(key);\n\n // Step 4: Encrypt Share A\n const encryptedA = await aesGcmEncryptToBase64(shareA, toEncryptionKey(key));\n\n // Step 5: Derive Solana public key\n const publicKey = getPublicKeyFromSeed(seed);\n const solanaPubkey = publicKeyToBase58(publicKey);\n\n // Step 6: Build enrollment request\n // Only send encrypted shares — never send the raw seed to the server\n const request: WalletEnrollRequest = {\n solanaPubkey,\n shareAAuthMethod: 'password',\n shareACiphertext: encryptedA.ciphertext,\n shareANonce: encryptedA.nonce,\n shareB: uint8ArrayToBase64(shareB),\n shareAKdfSalt: uint8ArrayToBase64(salt),\n shareAKdfParams: DEFAULT_KDF_PARAMS,\n };\n\n // Step 7: Upload to server\n // If accessToken provided, use it; otherwise rely on cookies\n const apiClient = new ApiClient({\n baseUrl: serverUrl,\n timeoutMs,\n getAccessToken: accessToken ? () => accessToken : undefined,\n });\n\n await apiClient.post('/wallet/enroll', request);\n\n return {\n success: true,\n solanaPubkey,\n };\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Wallet enrollment failed';\n // Silent failure - don't break registration flow\n return {\n success: false,\n error: errorMessage,\n };\n } finally {\n // Always wipe sensitive data\n wipeAll(...sensitiveData);\n }\n}\n"],"names":["silentWalletEnroll","options","password","serverUrl","accessToken","timeoutMs","sensitiveData","seed","generateSeed","shareA","shareB","splitSecret","salt","generateArgon2Salt","key","argon2DeriveInWorker","DEFAULT_KDF_PARAMS","encryptedA","aesGcmEncryptToBase64","toEncryptionKey","publicKey","getPublicKeyFromSeed","solanaPubkey","publicKeyToBase58","request","uint8ArrayToBase64","ApiClient","err","wipeAll"],"mappings":"wMA2DA,eAAsBA,EACpBC,EAC6B,CAC7B,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,YAAAC,EAAa,UAAAC,EAAY,KAAUJ,EAG1DK,EAA8B,CAAA,EAEpC,GAAI,CAEF,MAAMC,EAAOC,EAAAA,aAAA,EACbF,EAAc,KAAKC,CAAI,EAGvB,KAAM,CAAE,OAAAE,EAAQ,OAAAC,GAAWC,EAAAA,YAAYJ,CAAI,EAC3CD,EAAc,KAAKG,EAAQC,CAAM,EAGjC,MAAME,EAAOC,EAAAA,mBAAA,EACPC,EAAM,MAAMC,EAAAA,qBAAqBb,EAAUU,EAAMI,EAAAA,kBAAkB,EACzEV,EAAc,KAAKQ,CAAG,EAGtB,MAAMG,EAAa,MAAMC,EAAAA,sBAAsBT,EAAQU,EAAAA,gBAAgBL,CAAG,CAAC,EAGrEM,EAAYC,EAAAA,qBAAqBd,CAAI,EACrCe,EAAeC,EAAAA,kBAAkBH,CAAS,EAI1CI,EAA+B,CACnC,aAAAF,EACA,iBAAkB,WAClB,iBAAkBL,EAAW,WAC7B,YAAaA,EAAW,MACxB,OAAQQ,EAAAA,mBAAmBf,CAAM,EACjC,cAAee,EAAAA,mBAAmBb,CAAI,EACtC,gBAAiBI,EAAAA,kBAAA,EAWnB,aANkB,IAAIU,YAAU,CAC9B,QAASvB,EACT,UAAAE,EACA,eAAgBD,EAAc,IAAMA,EAAc,MAAA,CACnD,EAEe,KAAK,iBAAkBoB,CAAO,EAEvC,CACL,QAAS,GACT,aAAAF,CAAA,CAEJ,OAASK,EAAK,CAGZ,MAAO,CACL,QAAS,GACT,MAJmBA,aAAe,MAAQA,EAAI,QAAU,0BAIjD,CAEX,QAAA,CAEEC,EAAAA,QAAQ,GAAGtB,CAAa,CAC1B,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as g } from "./useCedrosLogin-CFfID-0i.js";
|
|
2
|
-
import { g as f, a as w, D as i, b as K, t as b, c as p, w as S } from "./useAuth-
|
|
3
|
-
import { s as T, a as k, g as B, p as D } from "./shamir-
|
|
2
|
+
import { g as f, a as w, D as i, b as K, t as b, c as p, w as S } from "./useAuth-CWBApIWg.js";
|
|
3
|
+
import { s as T, a as k, g as B, p as D } from "./shamir-BbDh58Zo.js";
|
|
4
4
|
async function P(u) {
|
|
5
5
|
const { password: A, serverUrl: h, accessToken: r, timeoutMs: y = 3e4 } = u, s = [];
|
|
6
6
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"silentWalletEnroll-
|
|
1
|
+
{"version":3,"file":"silentWalletEnroll-KHso2-HB.js","sources":["../src/utils/silentWalletEnroll.ts"],"sourcesContent":["/**\n * Silent wallet enrollment utility\n *\n * Performs wallet enrollment in the background without UI interaction.\n * Used for auto-enrolling wallets during registration.\n *\n * Security: Uses the same Shamir Secret Sharing scheme as manual enrollment.\n * The recovery phrase is not shown - user can retrieve it later if needed.\n */\n\nimport {\n generateSeed,\n generateArgon2Salt,\n splitSecret,\n argon2DeriveInWorker,\n aesGcmEncryptToBase64,\n uint8ArrayToBase64,\n getPublicKeyFromSeed,\n publicKeyToBase58,\n wipeAll,\n toEncryptionKey,\n DEFAULT_KDF_PARAMS,\n} from '../crypto';\nimport { ApiClient } from './apiClient';\nimport type { WalletEnrollRequest } from '../types/wallet';\n\nexport interface SilentEnrollOptions {\n /** User's password for Share A encryption */\n password: string;\n /** Server base URL */\n serverUrl: string;\n /** Access token for authentication (optional if using cookies) */\n accessToken?: string;\n /** Request timeout in ms */\n timeoutMs?: number;\n}\n\nexport interface SilentEnrollResult {\n success: boolean;\n solanaPubkey?: string;\n error?: string;\n}\n\n/**\n * Silently enroll a wallet for a user\n *\n * This function performs the complete wallet enrollment process:\n * 1. Generate 32-byte seed\n * 2. Split into 3 Shamir shares (threshold 2)\n * 3. Encrypt Share A with password-derived key (Argon2id)\n * 4. Derive Solana public key from seed\n * 5. Upload encrypted Share A + plaintext Share B to server\n *\n * The recovery phrase (Share C) is not returned - user can recover it\n * later through the wallet recovery flow if needed.\n *\n * @param options - Enrollment options\n * @returns Result with success status and Solana public key\n */\nexport async function silentWalletEnroll(\n options: SilentEnrollOptions\n): Promise<SilentEnrollResult> {\n const { password, serverUrl, accessToken, timeoutMs = 30000 } = options;\n\n // Track sensitive data for cleanup\n const sensitiveData: Uint8Array[] = [];\n\n try {\n // Step 1: Generate seed\n const seed = generateSeed();\n sensitiveData.push(seed);\n\n // Step 2: Split into shares\n const { shareA, shareB } = splitSecret(seed);\n sensitiveData.push(shareA, shareB);\n\n // Step 3: Derive encryption key from password\n const salt = generateArgon2Salt();\n const key = await argon2DeriveInWorker(password, salt, DEFAULT_KDF_PARAMS);\n sensitiveData.push(key);\n\n // Step 4: Encrypt Share A\n const encryptedA = await aesGcmEncryptToBase64(shareA, toEncryptionKey(key));\n\n // Step 5: Derive Solana public key\n const publicKey = getPublicKeyFromSeed(seed);\n const solanaPubkey = publicKeyToBase58(publicKey);\n\n // Step 6: Build enrollment request\n // Only send encrypted shares — never send the raw seed to the server\n const request: WalletEnrollRequest = {\n solanaPubkey,\n shareAAuthMethod: 'password',\n shareACiphertext: encryptedA.ciphertext,\n shareANonce: encryptedA.nonce,\n shareB: uint8ArrayToBase64(shareB),\n shareAKdfSalt: uint8ArrayToBase64(salt),\n shareAKdfParams: DEFAULT_KDF_PARAMS,\n };\n\n // Step 7: Upload to server\n // If accessToken provided, use it; otherwise rely on cookies\n const apiClient = new ApiClient({\n baseUrl: serverUrl,\n timeoutMs,\n getAccessToken: accessToken ? () => accessToken : undefined,\n });\n\n await apiClient.post('/wallet/enroll', request);\n\n return {\n success: true,\n solanaPubkey,\n };\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Wallet enrollment failed';\n // Silent failure - don't break registration flow\n return {\n success: false,\n error: errorMessage,\n };\n } finally {\n // Always wipe sensitive data\n wipeAll(...sensitiveData);\n }\n}\n"],"names":["silentWalletEnroll","options","password","serverUrl","accessToken","timeoutMs","sensitiveData","seed","generateSeed","shareA","shareB","splitSecret","salt","generateArgon2Salt","key","argon2DeriveInWorker","DEFAULT_KDF_PARAMS","encryptedA","aesGcmEncryptToBase64","toEncryptionKey","publicKey","getPublicKeyFromSeed","solanaPubkey","publicKeyToBase58","request","uint8ArrayToBase64","ApiClient","err","wipeAll"],"mappings":";;;AA2DA,eAAsBA,EACpBC,GAC6B;AAC7B,QAAM,EAAE,UAAAC,GAAU,WAAAC,GAAW,aAAAC,GAAa,WAAAC,IAAY,QAAUJ,GAG1DK,IAA8B,CAAA;AAEpC,MAAI;AAEF,UAAMC,IAAOC,EAAA;AACb,IAAAF,EAAc,KAAKC,CAAI;AAGvB,UAAM,EAAE,QAAAE,GAAQ,QAAAC,MAAWC,EAAYJ,CAAI;AAC3C,IAAAD,EAAc,KAAKG,GAAQC,CAAM;AAGjC,UAAME,IAAOC,EAAA,GACPC,IAAM,MAAMC,EAAqBb,GAAUU,GAAMI,CAAkB;AACzE,IAAAV,EAAc,KAAKQ,CAAG;AAGtB,UAAMG,IAAa,MAAMC,EAAsBT,GAAQU,EAAgBL,CAAG,CAAC,GAGrEM,IAAYC,EAAqBd,CAAI,GACrCe,IAAeC,EAAkBH,CAAS,GAI1CI,IAA+B;AAAA,MACnC,cAAAF;AAAA,MACA,kBAAkB;AAAA,MAClB,kBAAkBL,EAAW;AAAA,MAC7B,aAAaA,EAAW;AAAA,MACxB,QAAQQ,EAAmBf,CAAM;AAAA,MACjC,eAAee,EAAmBb,CAAI;AAAA,MACtC,iBAAiBI;AAAA,IAAA;AAWnB,iBANkB,IAAIU,EAAU;AAAA,MAC9B,SAASvB;AAAA,MACT,WAAAE;AAAA,MACA,gBAAgBD,IAAc,MAAMA,IAAc;AAAA,IAAA,CACnD,EAEe,KAAK,kBAAkBoB,CAAO,GAEvC;AAAA,MACL,SAAS;AAAA,MACT,cAAAF;AAAA,IAAA;AAAA,EAEJ,SAASK,GAAK;AAGZ,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAJmBA,aAAe,QAAQA,EAAI,UAAU;AAAA,IAIjD;AAAA,EAEX,UAAA;AAEE,IAAAC,EAAQ,GAAGtB,CAAa;AAAA,EAC1B;AACF;"}
|
package/dist/solana-only.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./useAuth-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./useAuth-GzGopI4v.cjs"),r=require("./useCedrosLogin-DtJorrE7.cjs"),e=require("./SolanaLoginButton-nSJHVFpZ.cjs"),n=require("./LoadingSpinner-d6sSxgQN.cjs"),i=require("./ErrorMessage-CHbYbVi2.cjs");exports.CedrosLoginProvider=o.CedrosLoginProvider;exports.useAuth=o.useAuth;exports.useCedrosLogin=r.useCedrosLogin;exports.SolanaLoginButton=e.SolanaLoginButton;exports.registerMobileWallet=e.registerMobileWallet;exports.useSolanaAuth=e.useSolanaAuth;exports.LoadingSpinner=n.LoadingSpinner;exports.ErrorMessage=i.ErrorMessage;
|
package/dist/solana-only.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ export declare interface AuthUser {
|
|
|
91
91
|
id: string;
|
|
92
92
|
email?: string;
|
|
93
93
|
name?: string;
|
|
94
|
+
username?: string;
|
|
94
95
|
picture?: string;
|
|
95
96
|
walletAddress?: string;
|
|
96
97
|
authMethods: AuthMethod[];
|
|
@@ -378,8 +379,8 @@ export declare interface MobileWalletConfig {
|
|
|
378
379
|
* Post-login action returned by the server after authentication
|
|
379
380
|
*/
|
|
380
381
|
declare interface PostLoginAction {
|
|
381
|
-
/** Action type: "welcome", "complete_profile", "redirect", or "setup_mfa" */
|
|
382
|
-
action: 'welcome' | 'complete_profile' | 'redirect' | 'setup_mfa';
|
|
382
|
+
/** Action type: "welcome", "choose_username", "complete_profile", "redirect", or "setup_mfa" */
|
|
383
|
+
action: 'welcome' | 'choose_username' | 'complete_profile' | 'redirect' | 'setup_mfa';
|
|
383
384
|
/** URL/route for redirect or welcome page */
|
|
384
385
|
redirectUrl?: string;
|
|
385
386
|
}
|
package/dist/solana-only.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, u as s } from "./useAuth-
|
|
1
|
+
import { C as e, u as s } from "./useAuth-CWBApIWg.js";
|
|
2
2
|
import { u as t } from "./useCedrosLogin-CFfID-0i.js";
|
|
3
3
|
import { S as u, r as i, u as g } from "./SolanaLoginButton-B04dib6X.js";
|
|
4
4
|
import { L as f } from "./LoadingSpinner-6vml-zwr.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as oe, jsxs as He } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as O, useState as
|
|
2
|
+
import { useEffect as O, useState as U, useRef as N, useCallback as E, useMemo as V } from "react";
|
|
3
3
|
import { A as Je, a as Me, C as Ve } from "./LoadingSpinner-6vml-zwr.js";
|
|
4
4
|
import { A as pe, g as se, a as ye, h as M, u as ke } from "./useCedrosLogin-CFfID-0i.js";
|
|
5
5
|
let q = 0;
|
|
@@ -34,10 +34,10 @@ const Ne = {
|
|
|
34
34
|
instantLink: !0
|
|
35
35
|
};
|
|
36
36
|
function Ye(e, t, A) {
|
|
37
|
-
const [i, r] =
|
|
37
|
+
const [i, r] = U(null), [n, o] = U(), [a, g] = U(), [s, k] = U(), [y, w] = U(), [b, Q] = U(t), u = N(!1);
|
|
38
38
|
return O(() => {
|
|
39
|
-
if (!t ||
|
|
40
|
-
|
|
39
|
+
if (!t || u.current) return;
|
|
40
|
+
u.current = !0, new pe({
|
|
41
41
|
baseUrl: e,
|
|
42
42
|
timeoutMs: A ?? 5e3,
|
|
43
43
|
retryAttempts: 1
|
|
@@ -49,13 +49,13 @@ function Ye(e, t, A) {
|
|
|
49
49
|
solana: C.solana,
|
|
50
50
|
webauthn: C.webauthn,
|
|
51
51
|
instantLink: C.instantLink
|
|
52
|
-
}), o(C.googleClientId), g(C.appleClientId), k(C.socialButtonOrder);
|
|
52
|
+
}), o(C.googleClientId), g(C.appleClientId), k(C.usernameEnabled), w(C.socialButtonOrder);
|
|
53
53
|
}).catch(() => {
|
|
54
54
|
r(Ne);
|
|
55
55
|
}).finally(() => {
|
|
56
|
-
|
|
56
|
+
Q(!1);
|
|
57
57
|
});
|
|
58
|
-
}, [t, e, A]), { features: i, googleClientId: n, appleClientId: a,
|
|
58
|
+
}, [t, e, A]), { features: i, googleClientId: n, appleClientId: a, usernameEnabled: s, socialButtonOrder: y, isLoading: b };
|
|
59
59
|
}
|
|
60
60
|
const Oe = "cedros_tokens", xe = 6e4;
|
|
61
61
|
class ve {
|
|
@@ -310,18 +310,18 @@ function Xe({
|
|
|
310
310
|
callbacks: A,
|
|
311
311
|
requestTimeoutMs: i
|
|
312
312
|
}) {
|
|
313
|
-
const [r, n] =
|
|
313
|
+
const [r, n] = U(null), [o, a] = U("idle"), g = N(null), s = N(null), k = N(A), y = N(!0), w = N(null), b = N(() => Promise.resolve()), Q = N(() => {
|
|
314
314
|
});
|
|
315
315
|
O(() => {
|
|
316
316
|
k.current = A;
|
|
317
317
|
}, [A]), O(() => (y.current = !0, () => {
|
|
318
318
|
y.current = !1;
|
|
319
319
|
}), []);
|
|
320
|
-
const
|
|
320
|
+
const u = E((h) => {
|
|
321
321
|
y.current && n(h);
|
|
322
322
|
}, []), B = E((h) => {
|
|
323
323
|
y.current && a(h);
|
|
324
|
-
}, []),
|
|
324
|
+
}, []), C = V(
|
|
325
325
|
() => ({
|
|
326
326
|
storage: t?.storage ?? "cookie",
|
|
327
327
|
autoRefresh: t?.autoRefresh ?? !0,
|
|
@@ -338,18 +338,18 @@ function Xe({
|
|
|
338
338
|
]
|
|
339
339
|
);
|
|
340
340
|
O(() => {
|
|
341
|
-
const h = new ve(
|
|
342
|
-
allowWebStorage:
|
|
341
|
+
const h = new ve(C.storage, C.persistKey, {
|
|
342
|
+
allowWebStorage: C.allowWebStorage
|
|
343
343
|
});
|
|
344
|
-
return g.current = h,
|
|
344
|
+
return g.current = h, C.autoRefresh && h.setRefreshCallback(() => b.current()), h.setSessionExpiredCallback(() => Q.current()), C.syncTabs && (s.current = new Re()), () => {
|
|
345
345
|
h.destroy(), g.current = null, s.current?.close();
|
|
346
346
|
};
|
|
347
347
|
}, [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
C.storage,
|
|
349
|
+
C.syncTabs,
|
|
350
|
+
C.persistKey,
|
|
351
|
+
C.allowWebStorage,
|
|
352
|
+
C.autoRefresh
|
|
353
353
|
]);
|
|
354
354
|
const K = E(async () => {
|
|
355
355
|
if (w.current)
|
|
@@ -377,7 +377,7 @@ function Xe({
|
|
|
377
377
|
if (!Le(ne.tokens))
|
|
378
378
|
throw new Error("Invalid token response structure");
|
|
379
379
|
g.current?.setTokens(ne.tokens);
|
|
380
|
-
} else if (
|
|
380
|
+
} else if (C.storage !== "cookie")
|
|
381
381
|
throw new Error("Token refresh failed");
|
|
382
382
|
s.current?.broadcastRefresh(), m();
|
|
383
383
|
} catch (X) {
|
|
@@ -392,15 +392,15 @@ function Xe({
|
|
|
392
392
|
} finally {
|
|
393
393
|
w.current = null;
|
|
394
394
|
}
|
|
395
|
-
}, [e,
|
|
396
|
-
if (
|
|
395
|
+
}, [e, C.storage, i]), p = E(() => {
|
|
396
|
+
if (C.storage === "cookie") return;
|
|
397
397
|
const h = g.current?.getAccessToken();
|
|
398
398
|
if (h)
|
|
399
399
|
return { Authorization: `Bearer ${h}` };
|
|
400
|
-
}, [
|
|
401
|
-
g.current?.clear(),
|
|
402
|
-
}, [B,
|
|
403
|
-
|
|
400
|
+
}, [C.storage]), F = E(() => {
|
|
401
|
+
g.current?.clear(), u(null), B("unauthenticated"), k.current?.onSessionExpired?.();
|
|
402
|
+
}, [B, u]);
|
|
403
|
+
b.current = K, Q.current = F;
|
|
404
404
|
const d = E(
|
|
405
405
|
(h) => {
|
|
406
406
|
const S = new AbortController(), G = i ?? 1e4, H = window.setTimeout(() => S.abort(), G), m = {}, J = p();
|
|
@@ -423,11 +423,11 @@ function Xe({
|
|
|
423
423
|
if (S.ok) {
|
|
424
424
|
const G = await S.json();
|
|
425
425
|
if (_(G)) {
|
|
426
|
-
|
|
426
|
+
u(G.user), B("authenticated");
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
if (S.status === 401 &&
|
|
430
|
+
if (S.status === 401 && C.autoRefresh) {
|
|
431
431
|
try {
|
|
432
432
|
await K();
|
|
433
433
|
} catch {
|
|
@@ -440,7 +440,7 @@ function Xe({
|
|
|
440
440
|
if (H.ok) {
|
|
441
441
|
const m = await H.json();
|
|
442
442
|
if (_(m)) {
|
|
443
|
-
|
|
443
|
+
u(m.user), B("authenticated");
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
@@ -448,29 +448,29 @@ function Xe({
|
|
|
448
448
|
G.cleanup();
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
|
|
451
|
+
u(null), B("unauthenticated");
|
|
452
452
|
} catch {
|
|
453
|
-
|
|
453
|
+
u(null), B("unauthenticated");
|
|
454
454
|
} finally {
|
|
455
455
|
h.cleanup();
|
|
456
456
|
}
|
|
457
457
|
}, [
|
|
458
458
|
e,
|
|
459
|
-
|
|
459
|
+
C.autoRefresh,
|
|
460
460
|
K,
|
|
461
461
|
d,
|
|
462
462
|
F,
|
|
463
463
|
B,
|
|
464
|
-
|
|
464
|
+
u
|
|
465
465
|
]);
|
|
466
466
|
O(() => {
|
|
467
|
-
!s.current || !
|
|
467
|
+
!s.current || !C.syncTabs || s.current.setCallback((h) => {
|
|
468
468
|
switch (h.type) {
|
|
469
469
|
case "login":
|
|
470
|
-
|
|
470
|
+
u(h.user), B("authenticated");
|
|
471
471
|
break;
|
|
472
472
|
case "logout":
|
|
473
|
-
|
|
473
|
+
u(null), B("unauthenticated"), g.current?.clear();
|
|
474
474
|
break;
|
|
475
475
|
case "refresh":
|
|
476
476
|
l();
|
|
@@ -479,7 +479,7 @@ function Xe({
|
|
|
479
479
|
console.warn("[Cedros Login] Unhandled tab sync event:", h);
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
|
-
}, [
|
|
482
|
+
}, [C.syncTabs, l, B, u]), O(() => {
|
|
483
483
|
const h = new AbortController(), S = i ?? 1e4, G = window.setTimeout(() => h.abort(), S);
|
|
484
484
|
return (async () => {
|
|
485
485
|
B("loading");
|
|
@@ -492,11 +492,11 @@ function Xe({
|
|
|
492
492
|
if (m.ok) {
|
|
493
493
|
const J = await m.json();
|
|
494
494
|
if (_(J)) {
|
|
495
|
-
|
|
495
|
+
u(J.user), B("authenticated");
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
if (m.status === 401 &&
|
|
499
|
+
if (m.status === 401 && C.autoRefresh) {
|
|
500
500
|
try {
|
|
501
501
|
await K();
|
|
502
502
|
} catch {
|
|
@@ -511,33 +511,33 @@ function Xe({
|
|
|
511
511
|
if (J.ok) {
|
|
512
512
|
const Y = await J.json();
|
|
513
513
|
if (_(Y)) {
|
|
514
|
-
|
|
514
|
+
u(Y.user), B("authenticated");
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
|
|
519
|
+
u(null), B("unauthenticated");
|
|
520
520
|
} catch {
|
|
521
|
-
|
|
521
|
+
u(null), B("unauthenticated");
|
|
522
522
|
}
|
|
523
523
|
})(), () => {
|
|
524
524
|
window.clearTimeout(G), h.abort();
|
|
525
525
|
};
|
|
526
526
|
}, [
|
|
527
527
|
e,
|
|
528
|
-
|
|
528
|
+
C.autoRefresh,
|
|
529
529
|
K,
|
|
530
530
|
p,
|
|
531
531
|
F,
|
|
532
532
|
B,
|
|
533
|
-
|
|
533
|
+
u,
|
|
534
534
|
i
|
|
535
535
|
]);
|
|
536
536
|
const I = E(
|
|
537
537
|
(h, S) => {
|
|
538
|
-
|
|
538
|
+
u(h), B("authenticated"), S && g.current?.setTokens(S), y.current && s.current?.broadcastLogin(h);
|
|
539
539
|
},
|
|
540
|
-
[
|
|
540
|
+
[u, B]
|
|
541
541
|
), c = E(async () => {
|
|
542
542
|
const h = se(), S = new AbortController(), G = i ?? 1e4, H = window.setTimeout(() => S.abort(), G);
|
|
543
543
|
try {
|
|
@@ -552,9 +552,9 @@ function Xe({
|
|
|
552
552
|
});
|
|
553
553
|
} catch {
|
|
554
554
|
} finally {
|
|
555
|
-
window.clearTimeout(H),
|
|
555
|
+
window.clearTimeout(H), u(null), B("unauthenticated"), g.current?.clear(), s.current?.broadcastLogout(), k.current?.onLogout?.();
|
|
556
556
|
}
|
|
557
|
-
}, [e, p,
|
|
557
|
+
}, [e, p, u, B, i]), f = E(() => g.current?.getAccessToken() ?? null, []);
|
|
558
558
|
return {
|
|
559
559
|
user: r,
|
|
560
560
|
authState: o,
|
|
@@ -919,7 +919,7 @@ function me(e, t) {
|
|
|
919
919
|
i = new Uint8Array(I, l, $);
|
|
920
920
|
}), w = (l = null) => {
|
|
921
921
|
r = !0, A.exports.Hash_Init(l);
|
|
922
|
-
},
|
|
922
|
+
}, b = (l) => {
|
|
923
923
|
let I = 0;
|
|
924
924
|
for (; I < l.length; ) {
|
|
925
925
|
const c = l.subarray(I, I + $);
|
|
@@ -929,12 +929,12 @@ function me(e, t) {
|
|
|
929
929
|
if (!r)
|
|
930
930
|
throw new Error("update() called before init()");
|
|
931
931
|
const I = v(l);
|
|
932
|
-
|
|
933
|
-
},
|
|
932
|
+
b(I);
|
|
933
|
+
}, u = new Uint8Array(t * 2), B = (l, I = null) => {
|
|
934
934
|
if (!r)
|
|
935
935
|
throw new Error("digest() called before init()");
|
|
936
|
-
return r = !1, A.exports.Hash_Final(I), l === "binary" ? i.slice(0, t) : ue(
|
|
937
|
-
},
|
|
936
|
+
return r = !1, A.exports.Hash_Final(I), l === "binary" ? i.slice(0, t) : ue(u, i, t);
|
|
937
|
+
}, C = () => {
|
|
938
938
|
if (!r)
|
|
939
939
|
throw new Error("save() can only be called after init() and before digest()");
|
|
940
940
|
const l = A.exports.Hash_GetState(), I = s(), c = A.exports.memory.buffer, f = new Uint8Array(c, l, I), h = new Uint8Array(W + I);
|
|
@@ -975,7 +975,7 @@ function me(e, t) {
|
|
|
975
975
|
if (!F(l, I))
|
|
976
976
|
return w(I), Q(l), B("hex", c);
|
|
977
977
|
const f = v(l);
|
|
978
|
-
return i.set(f), A.exports.Hash_Calculate(f.length, I, c), ue(
|
|
978
|
+
return i.set(f), A.exports.Hash_Calculate(f.length, I, c), ue(u, i, t);
|
|
979
979
|
};
|
|
980
980
|
return yield y(), {
|
|
981
981
|
getMemory: o,
|
|
@@ -985,7 +985,7 @@ function me(e, t) {
|
|
|
985
985
|
init: w,
|
|
986
986
|
update: Q,
|
|
987
987
|
digest: B,
|
|
988
|
-
save:
|
|
988
|
+
save: C,
|
|
989
989
|
load: K,
|
|
990
990
|
calculate: d,
|
|
991
991
|
hashLength: t
|
|
@@ -1081,14 +1081,14 @@ function Ut(e) {
|
|
|
1081
1081
|
fe(512)
|
|
1082
1082
|
]);
|
|
1083
1083
|
y.setMemorySize(s * 1024 + 1024);
|
|
1084
|
-
const
|
|
1085
|
-
Q.setInt32(0, A, !0), Q.setInt32(4, r, !0), Q.setInt32(8, s, !0), Q.setInt32(12, i, !0), Q.setInt32(16, a, !0), Q.setInt32(20, g, !0), y.writeMemory(
|
|
1086
|
-
const B = Math.floor(s / (A * 4)) * 4,
|
|
1087
|
-
|
|
1084
|
+
const b = new Uint8Array(24), Q = new DataView(b.buffer);
|
|
1085
|
+
Q.setInt32(0, A, !0), Q.setInt32(4, r, !0), Q.setInt32(8, s, !0), Q.setInt32(12, i, !0), Q.setInt32(16, a, !0), Q.setInt32(20, g, !0), y.writeMemory(b, s * 1024), w.init(), w.update(b), w.update(x(n.length)), w.update(n), w.update(x(o.length)), w.update(o), w.update(x(k.length)), w.update(k), w.update(x(0));
|
|
1086
|
+
const B = Math.floor(s / (A * 4)) * 4, C = new Uint8Array(72), K = w.digest("binary");
|
|
1087
|
+
C.set(K);
|
|
1088
1088
|
for (let d = 0; d < A; d++) {
|
|
1089
|
-
|
|
1090
|
-
let l = d * B, I = yield le(w,
|
|
1091
|
-
y.writeMemory(I, l * 1024), l += 1,
|
|
1089
|
+
C.set(x(0), 64), C.set(x(d), 68);
|
|
1090
|
+
let l = d * B, I = yield le(w, C, 1024);
|
|
1091
|
+
y.writeMemory(I, l * 1024), l += 1, C.set(x(1), 64), I = yield le(w, C, 1024), y.writeMemory(I, l * 1024);
|
|
1092
1092
|
}
|
|
1093
1093
|
const p = new Uint8Array(1024);
|
|
1094
1094
|
Ue(p, y.calculate(new Uint8Array([]), s));
|
|
@@ -1431,7 +1431,7 @@ function xt(e) {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
1433
|
function vt() {
|
|
1434
|
-
const e = ye(), [t, A] =
|
|
1434
|
+
const e = ye(), [t, A] = U(!1), [i, r] = U(null), n = e?.config.serverUrl, o = e?.config.requestTimeout, a = e?.config.retryAttempts, g = e?._internal?.getAccessToken, s = V(() => e ? new pe({
|
|
1435
1435
|
baseUrl: n,
|
|
1436
1436
|
timeoutMs: o,
|
|
1437
1437
|
retryAttempts: a,
|
|
@@ -1477,7 +1477,7 @@ function vt() {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
},
|
|
1479
1479
|
[s]
|
|
1480
|
-
),
|
|
1480
|
+
), b = E(
|
|
1481
1481
|
async (I) => {
|
|
1482
1482
|
if (!s)
|
|
1483
1483
|
throw new Error("useWalletMaterial must be used within a CedrosLoginProvider");
|
|
@@ -1507,7 +1507,7 @@ function vt() {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
},
|
|
1509
1509
|
[s]
|
|
1510
|
-
),
|
|
1510
|
+
), u = E(
|
|
1511
1511
|
async (I) => {
|
|
1512
1512
|
if (!s)
|
|
1513
1513
|
throw new Error("useWalletMaterial must be used within a CedrosLoginProvider");
|
|
@@ -1540,7 +1540,7 @@ function vt() {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
},
|
|
1542
1542
|
[s]
|
|
1543
|
-
),
|
|
1543
|
+
), C = E(async () => {
|
|
1544
1544
|
if (!s)
|
|
1545
1545
|
throw new Error("useWalletMaterial must be used within a CedrosLoginProvider");
|
|
1546
1546
|
A(!0), r(null);
|
|
@@ -1614,11 +1614,11 @@ function vt() {
|
|
|
1614
1614
|
getStatus: k,
|
|
1615
1615
|
getMaterial: y,
|
|
1616
1616
|
enroll: w,
|
|
1617
|
-
recover:
|
|
1617
|
+
recover: b,
|
|
1618
1618
|
signTransaction: Q,
|
|
1619
|
-
rotateUserSecret:
|
|
1619
|
+
rotateUserSecret: u,
|
|
1620
1620
|
unlock: B,
|
|
1621
|
-
lock:
|
|
1621
|
+
lock: C,
|
|
1622
1622
|
getShareBForRecovery: K,
|
|
1623
1623
|
createDerivedWallet: p,
|
|
1624
1624
|
listAllWallets: F,
|
|
@@ -1643,7 +1643,7 @@ const Tt = {
|
|
|
1643
1643
|
}
|
|
1644
1644
|
};
|
|
1645
1645
|
function Rt() {
|
|
1646
|
-
const t = ye() !== null, [A, i] =
|
|
1646
|
+
const t = ye() !== null, [A, i] = U("loading"), [r, n] = U(null), [o, a] = U(null), [g, s] = U(!1), [k, y] = U(!1), [w, b] = U(null), [Q, u] = U(null), { getStatus: B, isLoading: C } = vt(), K = N(!1);
|
|
1647
1647
|
O(() => {
|
|
1648
1648
|
if (!t) return;
|
|
1649
1649
|
let d = !1;
|
|
@@ -1651,12 +1651,12 @@ function Rt() {
|
|
|
1651
1651
|
try {
|
|
1652
1652
|
const I = await Ot();
|
|
1653
1653
|
if (d) return;
|
|
1654
|
-
|
|
1654
|
+
b(I), I.allSupported || (i("error"), u(
|
|
1655
1655
|
"Your browser or device does not support all required features. Please use a modern browser with a platform authenticator."
|
|
1656
1656
|
));
|
|
1657
1657
|
} catch {
|
|
1658
1658
|
if (d) return;
|
|
1659
|
-
|
|
1659
|
+
b(null), i("error"), u("Failed to check crypto capabilities");
|
|
1660
1660
|
}
|
|
1661
1661
|
})(), () => {
|
|
1662
1662
|
d = !0;
|
|
@@ -1664,19 +1664,19 @@ function Rt() {
|
|
|
1664
1664
|
}, [t]);
|
|
1665
1665
|
const p = E(async () => {
|
|
1666
1666
|
if (!(!t || !w?.allSupported)) {
|
|
1667
|
-
i("loading"),
|
|
1667
|
+
i("loading"), u(null);
|
|
1668
1668
|
try {
|
|
1669
1669
|
const d = await B();
|
|
1670
1670
|
n(d.solanaPubkey ?? null), a(d.authMethod ?? null), s(d.hasExternalWallet), y(d.unlocked), d.hasExternalWallet ? i("enrolled_unlocked") : d.enrolled ? i(d.unlocked ? "enrolled_unlocked" : "enrolled_locked") : i("not_enrolled");
|
|
1671
1671
|
} catch (d) {
|
|
1672
|
-
i("error"),
|
|
1672
|
+
i("error"), u(d instanceof Error ? d.message : "Failed to fetch wallet status");
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
1675
|
}, [t, w?.allSupported, B]);
|
|
1676
1676
|
O(() => {
|
|
1677
|
-
t && w?.allSupported && !
|
|
1678
|
-
}, [t, w?.allSupported,
|
|
1679
|
-
const F = E(() =>
|
|
1677
|
+
t && w?.allSupported && !C && !K.current && (K.current = !0, p());
|
|
1678
|
+
}, [t, w?.allSupported, C, p]);
|
|
1679
|
+
const F = E(() => u(null), []);
|
|
1680
1680
|
return t ? {
|
|
1681
1681
|
status: A,
|
|
1682
1682
|
solanaPubkey: r,
|
|
@@ -1726,7 +1726,7 @@ function Xt() {
|
|
|
1726
1726
|
}, [n, o, t, A, i, r]), null;
|
|
1727
1727
|
}
|
|
1728
1728
|
function gA({ config: e, children: t }) {
|
|
1729
|
-
const [A, i] =
|
|
1729
|
+
const [A, i] = U(null), [r, n] = U(!1), o = N(e.callbacks);
|
|
1730
1730
|
o.current = e.callbacks;
|
|
1731
1731
|
const a = N({
|
|
1732
1732
|
onLoginSuccess: (...L) => o.current?.onLoginSuccess?.(...L),
|
|
@@ -1738,7 +1738,7 @@ function gA({ config: e, children: t }) {
|
|
|
1738
1738
|
googleClientId: k,
|
|
1739
1739
|
appleClientId: y,
|
|
1740
1740
|
socialButtonOrder: w,
|
|
1741
|
-
isLoading:
|
|
1741
|
+
isLoading: b
|
|
1742
1742
|
} = Ye(
|
|
1743
1743
|
e.serverUrl,
|
|
1744
1744
|
g,
|
|
@@ -1748,10 +1748,10 @@ function gA({ config: e, children: t }) {
|
|
|
1748
1748
|
features: s,
|
|
1749
1749
|
googleClientId: e.googleClientId ?? k,
|
|
1750
1750
|
appleClientId: e.appleClientId ?? y
|
|
1751
|
-
}, [e, g, s, k, y]),
|
|
1751
|
+
}, [e, g, s, k, y]), u = V(
|
|
1752
1752
|
() => JSON.stringify(Q.themeOverrides ?? null),
|
|
1753
1753
|
[Q.themeOverrides]
|
|
1754
|
-
), B = V(() => JSON.stringify(Q.session ?? null), [Q.session]),
|
|
1754
|
+
), B = V(() => JSON.stringify(Q.session ?? null), [Q.session]), C = V(() => JSON.stringify(Q.features ?? null), [Q.features]), K = V(() => JSON.stringify(Q.forms ?? null), [Q.forms]), p = V(
|
|
1755
1755
|
() => Q,
|
|
1756
1756
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- Using serialized keys for deep comparison; callbacks excluded (see UI-06)
|
|
1757
1757
|
[
|
|
@@ -1761,9 +1761,9 @@ function gA({ config: e, children: t }) {
|
|
|
1761
1761
|
Q.requestTimeout,
|
|
1762
1762
|
Q.retryAttempts,
|
|
1763
1763
|
Q.theme,
|
|
1764
|
-
C,
|
|
1765
|
-
B,
|
|
1766
1764
|
u,
|
|
1765
|
+
B,
|
|
1766
|
+
C,
|
|
1767
1767
|
K
|
|
1768
1768
|
]
|
|
1769
1769
|
);
|
|
@@ -1816,7 +1816,7 @@ function gA({ config: e, children: t }) {
|
|
|
1816
1816
|
() => ({ ...m, ...J }),
|
|
1817
1817
|
[m, J]
|
|
1818
1818
|
);
|
|
1819
|
-
return g &&
|
|
1819
|
+
return g && b ? null : /* @__PURE__ */ oe(Je.Provider, { value: m, children: /* @__PURE__ */ oe(Me.Provider, { value: J, children: /* @__PURE__ */ He(Ve.Provider, { value: Y, children: [
|
|
1820
1820
|
/* @__PURE__ */ oe(Xt, {}),
|
|
1821
1821
|
t
|
|
1822
1822
|
] }) }) });
|