@bounded-sh/client 0.0.20 → 0.0.22
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/README.md +2 -2
- package/dist/index.js +159 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +159 -33
- package/dist/index.mjs.map +1 -1
- package/dist/{index.native-BtM38BVP.js → index.native-C4a8IUpM.js} +163 -37
- package/dist/index.native-C4a8IUpM.js.map +1 -0
- package/dist/{index.native-w12aoVNW.mjs → index.native-C9PMGtxX.mjs} +163 -37
- package/dist/index.native-C9PMGtxX.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{phantom-wallet-provider-BJWelaiH.js → phantom-wallet-provider-BPRRcIaN.js} +2 -2
- package/dist/{phantom-wallet-provider-BJWelaiH.js.map → phantom-wallet-provider-BPRRcIaN.js.map} +1 -1
- package/dist/{phantom-wallet-provider-BT2V4EU5.mjs → phantom-wallet-provider-DhpV9xKE.mjs} +2 -2
- package/dist/{phantom-wallet-provider-BT2V4EU5.mjs.map → phantom-wallet-provider-DhpV9xKE.mjs.map} +1 -1
- package/dist/{privy-wallet-provider-LV1X7hZe.mjs → privy-wallet-provider-B6QyPXqq.mjs} +3 -3
- package/dist/{privy-wallet-provider-LV1X7hZe.mjs.map → privy-wallet-provider-B6QyPXqq.mjs.map} +1 -1
- package/dist/{privy-wallet-provider-BSh0aZVL.js → privy-wallet-provider-D4W91sqG.js} +3 -3
- package/dist/{privy-wallet-provider-BSh0aZVL.js.map → privy-wallet-provider-D4W91sqG.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-CKsfiyDd.js → solana-mobile-wallet-provider-B0O0BctB.js} +2 -2
- package/dist/{solana-mobile-wallet-provider-CKsfiyDd.js.map → solana-mobile-wallet-provider-B0O0BctB.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-NLe9_mEn.mjs → solana-mobile-wallet-provider-OGKifgCZ.mjs} +2 -2
- package/dist/{solana-mobile-wallet-provider-NLe9_mEn.mjs.map → solana-mobile-wallet-provider-OGKifgCZ.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/index.native-BtM38BVP.js.map +0 -1
- package/dist/index.native-w12aoVNW.mjs.map +0 -1
|
@@ -3965,13 +3965,44 @@ function createEmailModalTree() {
|
|
|
3965
3965
|
close.type = 'button';
|
|
3966
3966
|
close.textContent = '×';
|
|
3967
3967
|
card.appendChild(close);
|
|
3968
|
+
// Brand row — the real Bounded mark (same geometry as bounded.sh) + wordmark.
|
|
3968
3969
|
const brand = document.createElement('div');
|
|
3969
3970
|
brand.className = 'ba-brand';
|
|
3970
|
-
const
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3971
|
+
const mark = document.createElement('span');
|
|
3972
|
+
mark.className = 'ba-mark';
|
|
3973
|
+
mark.setAttribute('aria-hidden', 'true');
|
|
3974
|
+
const svgNs = 'http://www.w3.org/2000/svg';
|
|
3975
|
+
const markSvg = document.createElementNS(svgNs, 'svg');
|
|
3976
|
+
markSvg.setAttribute('width', '24');
|
|
3977
|
+
markSvg.setAttribute('height', '24');
|
|
3978
|
+
markSvg.setAttribute('viewBox', '0 0 32 32');
|
|
3979
|
+
markSvg.setAttribute('fill', 'none');
|
|
3980
|
+
for (const [className, d] of [
|
|
3981
|
+
['ba-c ba-c1', 'M16 5 H5 V16'],
|
|
3982
|
+
['ba-c ba-c2', 'M16 5 H27 V16'],
|
|
3983
|
+
['ba-c ba-c3', 'M5 16 V27 H16'],
|
|
3984
|
+
['ba-c ba-c4', 'M27 16 V27 H16'],
|
|
3985
|
+
]) {
|
|
3986
|
+
const path = document.createElementNS(svgNs, 'path');
|
|
3987
|
+
path.setAttribute('class', className);
|
|
3988
|
+
path.setAttribute('d', d);
|
|
3989
|
+
markSvg.appendChild(path);
|
|
3990
|
+
}
|
|
3991
|
+
mark.appendChild(markSvg);
|
|
3992
|
+
brand.appendChild(mark);
|
|
3993
|
+
const word = document.createElement('span');
|
|
3994
|
+
word.className = 'ba-word';
|
|
3995
|
+
word.textContent = 'bounded';
|
|
3996
|
+
brand.appendChild(word);
|
|
3974
3997
|
card.appendChild(brand);
|
|
3998
|
+
const title = document.createElement('h1');
|
|
3999
|
+
title.className = 'ba-title';
|
|
4000
|
+
title.textContent = 'Sign in';
|
|
4001
|
+
card.appendChild(title);
|
|
4002
|
+
const sub = document.createElement('p');
|
|
4003
|
+
sub.className = 'ba-subtitle';
|
|
4004
|
+
sub.textContent = 'Continue with your email — no wallet needed.';
|
|
4005
|
+
card.appendChild(sub);
|
|
3975
4006
|
const emailStep = document.createElement('div');
|
|
3976
4007
|
emailStep.id = 'ba-email-step';
|
|
3977
4008
|
card.appendChild(emailStep);
|
|
@@ -3992,7 +4023,7 @@ function createEmailModalTree() {
|
|
|
3992
4023
|
emailButton.id = 'ba-email-btn';
|
|
3993
4024
|
emailButton.className = 'ba-btn';
|
|
3994
4025
|
emailButton.type = 'button';
|
|
3995
|
-
emailButton.textContent = 'Continue';
|
|
4026
|
+
emailButton.textContent = 'Continue with email';
|
|
3996
4027
|
emailStep.appendChild(emailButton);
|
|
3997
4028
|
const otpStep = document.createElement('div');
|
|
3998
4029
|
otpStep.id = 'ba-otp-step';
|
|
@@ -4037,37 +4068,67 @@ function createEmailModalTree() {
|
|
|
4037
4068
|
card.appendChild(foot);
|
|
4038
4069
|
return root;
|
|
4039
4070
|
}
|
|
4071
|
+
// Design language matches the hosted Bounded login (auth.bounded.sh) and bounded.sh:
|
|
4072
|
+
// dark editorial panel, green accent, Schibsted Grotesk / Newsreader / JetBrains Mono,
|
|
4073
|
+
// the Bounded mark drawing itself in. Fonts load best-effort (scoped @import); every
|
|
4074
|
+
// rule has a system fallback so the modal looks right even if Google Fonts is blocked.
|
|
4075
|
+
// All selectors are scoped under #bounded-auth-modal so we never leak into the host page.
|
|
4040
4076
|
const MODAL_CSS = `
|
|
4041
|
-
|
|
4077
|
+
@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500&family=Schibsted+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');
|
|
4078
|
+
#bounded-auth-modal{--ba-bg:#0a0a0b;--ba-panel:#0e0f11;--ba-inset:#060607;--ba-raise:#131416;
|
|
4079
|
+
--ba-line:rgba(232,230,222,.08);--ba-line-strong:rgba(232,230,222,.16);
|
|
4080
|
+
--ba-text:#e8e6de;--ba-dim:#9b9991;--ba-faint:#85837c;--ba-green:#58c98f;
|
|
4081
|
+
--ba-green-bg:rgba(88,201,143,.09);--ba-green-line:rgba(88,201,143,.28);--ba-red:#ec8488;
|
|
4082
|
+
--ba-body:'Schibsted Grotesk',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
|
|
4083
|
+
--ba-display:'Newsreader','Iowan Old Style',Georgia,serif;
|
|
4084
|
+
--ba-mono:'JetBrains Mono',ui-monospace,'SF Mono',Menlo,monospace;}
|
|
4085
|
+
#bounded-auth-modal .ba-overlay{position:fixed;inset:0;background:rgba(6,6,7,.66);backdrop-filter:blur(4px);
|
|
4042
4086
|
display:flex;align-items:center;justify-content:center;z-index:2147483000;opacity:1;transition:opacity .16s ease;
|
|
4043
|
-
font-family
|
|
4087
|
+
font-family:var(--ba-body);padding:16px;}
|
|
4044
4088
|
#bounded-auth-modal .ba-overlay.out{opacity:0;}
|
|
4045
|
-
#bounded-auth-modal
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
#bounded-auth-modal .ba-
|
|
4054
|
-
#bounded-auth-modal .ba-
|
|
4055
|
-
#bounded-auth-modal .ba-
|
|
4056
|
-
#bounded-auth-modal .ba-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
#bounded-auth-modal .ba-
|
|
4060
|
-
#bounded-auth-modal .ba-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
#bounded-auth-modal .ba-
|
|
4064
|
-
#bounded-auth-modal .ba-
|
|
4065
|
-
#bounded-auth-modal .ba-
|
|
4066
|
-
#bounded-auth-modal .ba-
|
|
4067
|
-
#bounded-auth-modal .ba-
|
|
4068
|
-
#bounded-auth-modal .ba-
|
|
4089
|
+
#bounded-auth-modal *{box-sizing:border-box;}
|
|
4090
|
+
#bounded-auth-modal .ba-card{width:100%;max-width:372px;background:var(--ba-panel);color:var(--ba-text);
|
|
4091
|
+
border:1px solid var(--ba-line);border-radius:12px;padding:28px 28px 22px;position:relative;
|
|
4092
|
+
box-shadow:0 1px 0 rgba(232,230,222,.03) inset,0 30px 80px -40px rgba(0,0,0,.8);animation:ba-in .18s ease;}
|
|
4093
|
+
@keyframes ba-in{from{transform:translateY(8px);opacity:.5}to{transform:translateY(0);opacity:1}}
|
|
4094
|
+
#bounded-auth-modal .ba-x{position:absolute;top:14px;right:14px;width:28px;height:28px;border:1px solid var(--ba-line);
|
|
4095
|
+
background:var(--ba-raise);color:var(--ba-faint);border-radius:7px;font-size:18px;line-height:1;cursor:pointer;
|
|
4096
|
+
transition:color .15s,border-color .15s;}
|
|
4097
|
+
#bounded-auth-modal .ba-x:hover{color:var(--ba-text);border-color:var(--ba-faint);}
|
|
4098
|
+
#bounded-auth-modal .ba-brand{display:flex;align-items:center;gap:10px;margin:0 0 24px;}
|
|
4099
|
+
#bounded-auth-modal .ba-mark{display:flex;color:var(--ba-text);}
|
|
4100
|
+
#bounded-auth-modal .ba-mark svg{overflow:visible;display:block;}
|
|
4101
|
+
#bounded-auth-modal .ba-c{stroke:currentColor;stroke-width:2.4;fill:none;}
|
|
4102
|
+
@media (prefers-reduced-motion:no-preference){
|
|
4103
|
+
#bounded-auth-modal .ba-c{stroke-dasharray:23;stroke-dashoffset:23;animation:ba-draw .4s cubic-bezier(.45,0,.2,1) forwards;}
|
|
4104
|
+
#bounded-auth-modal .ba-c1{animation-delay:.1s}#bounded-auth-modal .ba-c2{animation-delay:.38s}
|
|
4105
|
+
#bounded-auth-modal .ba-c3{animation-delay:.66s}#bounded-auth-modal .ba-c4{animation-delay:.94s}}
|
|
4106
|
+
@keyframes ba-draw{to{stroke-dashoffset:0}}
|
|
4107
|
+
#bounded-auth-modal .ba-word{font-family:var(--ba-body);font-weight:500;font-size:15px;letter-spacing:.2px;color:var(--ba-text);}
|
|
4108
|
+
#bounded-auth-modal .ba-title{font-family:var(--ba-display);font-weight:400;font-size:25px;letter-spacing:-.01em;margin:0 0 5px;}
|
|
4109
|
+
#bounded-auth-modal .ba-subtitle{color:var(--ba-dim);font-size:14px;margin:0 0 22px;}
|
|
4110
|
+
#bounded-auth-modal .ba-label{display:block;font-size:12px;color:var(--ba-dim);margin:0 0 7px;}
|
|
4111
|
+
#bounded-auth-modal .ba-em{color:var(--ba-text);font-weight:600;}
|
|
4112
|
+
#bounded-auth-modal .ba-input{width:100%;background:var(--ba-inset);border:1px solid var(--ba-line-strong);color:var(--ba-text);
|
|
4113
|
+
border-radius:6px;padding:11px 13px;font-family:var(--ba-body);font-size:15px;outline:none;transition:border-color .15s,box-shadow .15s;}
|
|
4114
|
+
#bounded-auth-modal .ba-input::placeholder{color:var(--ba-faint);}
|
|
4115
|
+
#bounded-auth-modal .ba-input:focus{border-color:var(--ba-green-line);box-shadow:0 0 0 3px var(--ba-green-bg);}
|
|
4116
|
+
#bounded-auth-modal .ba-code{font-family:var(--ba-mono);letter-spacing:8px;text-align:center;font-size:21px;padding-left:8px;}
|
|
4117
|
+
#bounded-auth-modal .ba-btn{width:100%;margin-top:16px;background:var(--ba-text);color:var(--ba-bg);
|
|
4118
|
+
border:0;border-radius:6px;padding:12px;font-family:var(--ba-body);font-size:14px;font-weight:600;cursor:pointer;
|
|
4119
|
+
transition:opacity .15s,transform .04s;}
|
|
4120
|
+
#bounded-auth-modal .ba-btn:hover{opacity:.9;}
|
|
4121
|
+
#bounded-auth-modal .ba-btn:active{transform:translateY(.5px);}
|
|
4122
|
+
#bounded-auth-modal .ba-btn:disabled{opacity:.45;cursor:default;}
|
|
4123
|
+
#bounded-auth-modal .ba-link{width:100%;margin-top:14px;background:none;border:none;color:var(--ba-dim);
|
|
4124
|
+
font-family:var(--ba-body);font-size:12.5px;cursor:pointer;}
|
|
4125
|
+
#bounded-auth-modal .ba-link:hover{color:var(--ba-text);}
|
|
4126
|
+
#bounded-auth-modal .ba-msg{min-height:16px;margin-top:16px;font-size:12.5px;color:var(--ba-dim);text-align:center;}
|
|
4127
|
+
#bounded-auth-modal .ba-msg.err{color:var(--ba-red);}
|
|
4128
|
+
#bounded-auth-modal .ba-foot{margin-top:26px;padding-top:16px;border-top:1px solid var(--ba-line);
|
|
4129
|
+
text-align:center;font-size:11px;color:var(--ba-faint);}
|
|
4069
4130
|
#bounded-auth-modal .hidden{display:none;}
|
|
4070
|
-
@media (max-width:480px){#bounded-auth-modal .ba-card{max-width:none;
|
|
4131
|
+
@media (max-width:480px){#bounded-auth-modal .ba-card{max-width:none;}}`;
|
|
4071
4132
|
|
|
4072
4133
|
const SURFNET_RPC_URL = "https://surfpool.fly.dev";
|
|
4073
4134
|
const SUPPORTED_SOLANA_NETWORKS = new Set([
|
|
@@ -4114,6 +4175,7 @@ function resolveSolanaRpcUrl(explicitRpcUrl, network, context) {
|
|
|
4114
4175
|
}
|
|
4115
4176
|
|
|
4116
4177
|
const PKCE_STORE_KEY = 'bounded.oidc.pkce';
|
|
4178
|
+
const STORED_AUTH_METHOD_KEY$1 = 'bounded_last_auth_method';
|
|
4117
4179
|
// Active session store (Web on web, RN on React Native) — selected by config,
|
|
4118
4180
|
// not by `typeof window` (truthy on RN). OIDC redirect/popup is web-only, but the
|
|
4119
4181
|
// session it mints is read back through this same selector everywhere.
|
|
@@ -4408,6 +4470,10 @@ async function exchangeCode(code, verifier, redirectUri) {
|
|
|
4408
4470
|
const refreshToken = tokenField(data, 'refresh_token', 'refreshToken');
|
|
4409
4471
|
const user = userFromIdToken(idToken);
|
|
4410
4472
|
await sessionManager().storeSession(String(user.address || ''), accessToken, idToken, refreshToken, base);
|
|
4473
|
+
try {
|
|
4474
|
+
getPlatform().storage.setItem(STORED_AUTH_METHOD_KEY$1, 'email');
|
|
4475
|
+
}
|
|
4476
|
+
catch ( /* storage unavailable */_b) { /* storage unavailable */ }
|
|
4411
4477
|
setCurrentUser(user);
|
|
4412
4478
|
setAuthProviderInstance(oidcProviderSingleton);
|
|
4413
4479
|
return user;
|
|
@@ -4418,7 +4484,10 @@ async function exchangeCode(code, verifier, redirectUri) {
|
|
|
4418
4484
|
// (react-dom) when this module is imported on RN.
|
|
4419
4485
|
let currentAuthProvider = null;
|
|
4420
4486
|
let currentAuthMethod = null;
|
|
4487
|
+
let currentAuthProviderConfigKey = null;
|
|
4421
4488
|
let initConfig = null;
|
|
4489
|
+
const objectIdentityKeys = new WeakMap();
|
|
4490
|
+
let nextObjectIdentityKey = 1;
|
|
4422
4491
|
// --- localStorage helpers: track which auth method created the active session ---
|
|
4423
4492
|
const STORED_AUTH_METHOD_KEY = 'bounded_last_auth_method';
|
|
4424
4493
|
function getStoredAuthMethod() {
|
|
@@ -4442,6 +4511,51 @@ function setStoredAuthMethod(method) {
|
|
|
4442
4511
|
// storage might not be available
|
|
4443
4512
|
}
|
|
4444
4513
|
}
|
|
4514
|
+
function objectIdentityKey(value) {
|
|
4515
|
+
if (!value || (typeof value !== 'object' && typeof value !== 'function'))
|
|
4516
|
+
return null;
|
|
4517
|
+
const obj = value;
|
|
4518
|
+
let id = objectIdentityKeys.get(obj);
|
|
4519
|
+
if (!id) {
|
|
4520
|
+
id = nextObjectIdentityKey++;
|
|
4521
|
+
objectIdentityKeys.set(obj, id);
|
|
4522
|
+
}
|
|
4523
|
+
return `object:${id}`;
|
|
4524
|
+
}
|
|
4525
|
+
function stableConfigValue(value, seen = new WeakSet()) {
|
|
4526
|
+
if (value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')
|
|
4527
|
+
return value;
|
|
4528
|
+
if (typeof value === 'function')
|
|
4529
|
+
return '[function]';
|
|
4530
|
+
if (Array.isArray(value))
|
|
4531
|
+
return value.map((item) => stableConfigValue(item, seen));
|
|
4532
|
+
if (typeof value === 'object') {
|
|
4533
|
+
if (seen.has(value))
|
|
4534
|
+
return '[circular]';
|
|
4535
|
+
seen.add(value);
|
|
4536
|
+
const out = {};
|
|
4537
|
+
for (const key of Object.keys(value).sort()) {
|
|
4538
|
+
out[key] = stableConfigValue(value[key], seen);
|
|
4539
|
+
}
|
|
4540
|
+
seen.delete(value);
|
|
4541
|
+
return out;
|
|
4542
|
+
}
|
|
4543
|
+
return String(value);
|
|
4544
|
+
}
|
|
4545
|
+
function authProviderConfigKey(config) {
|
|
4546
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4547
|
+
return JSON.stringify({
|
|
4548
|
+
authMethod: (_a = config.authMethod) !== null && _a !== void 0 ? _a : null,
|
|
4549
|
+
chain: (_b = config.chain) !== null && _b !== void 0 ? _b : null,
|
|
4550
|
+
rpcUrl: normalizeSolanaRpcUrl(config.rpcUrl),
|
|
4551
|
+
name: (_c = config.name) !== null && _c !== void 0 ? _c : null,
|
|
4552
|
+
logoUrl: (_d = config.logoUrl) !== null && _d !== void 0 ? _d : null,
|
|
4553
|
+
phantomConfig: stableConfigValue((_e = config.phantomConfig) !== null && _e !== void 0 ? _e : null),
|
|
4554
|
+
privyConfig: stableConfigValue((_f = config.privyConfig) !== null && _f !== void 0 ? _f : null),
|
|
4555
|
+
mobileWalletConfig: stableConfigValue((_g = config.mobileWalletConfig) !== null && _g !== void 0 ? _g : null),
|
|
4556
|
+
privyExpoProvider: objectIdentityKey((_h = config.privyExpoProvider) !== null && _h !== void 0 ? _h : null),
|
|
4557
|
+
});
|
|
4558
|
+
}
|
|
4445
4559
|
/**
|
|
4446
4560
|
* Clears the session if it was created by a different auth method.
|
|
4447
4561
|
* Returns true if the session was cleared, false if the session is compatible.
|
|
@@ -4467,17 +4581,17 @@ function clearIncompatibleSession() {
|
|
|
4467
4581
|
// Lazy loaders for web-only providers.
|
|
4468
4582
|
// Using dynamic import() ensures Metro (RN) never resolves these modules.
|
|
4469
4583
|
async function loadPhantomWalletProvider() {
|
|
4470
|
-
const mod = await import('./phantom-wallet-provider-
|
|
4584
|
+
const mod = await import('./phantom-wallet-provider-DhpV9xKE.mjs');
|
|
4471
4585
|
return { PhantomWalletProvider: mod.PhantomWalletProvider };
|
|
4472
4586
|
}
|
|
4473
4587
|
// Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
|
|
4474
4588
|
// never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
|
|
4475
4589
|
async function loadPrivyWalletProvider() {
|
|
4476
|
-
const mod = await import('./privy-wallet-provider-
|
|
4590
|
+
const mod = await import('./privy-wallet-provider-B6QyPXqq.mjs');
|
|
4477
4591
|
return mod.PrivyWalletProvider;
|
|
4478
4592
|
}
|
|
4479
4593
|
async function loadSolanaMobileWalletProvider() {
|
|
4480
|
-
const mod = await import('./solana-mobile-wallet-provider-
|
|
4594
|
+
const mod = await import('./solana-mobile-wallet-provider-OGKifgCZ.mjs');
|
|
4481
4595
|
return mod.SolanaMobileWalletProvider;
|
|
4482
4596
|
}
|
|
4483
4597
|
function requireWebPrivyConfig(config) {
|
|
@@ -4547,6 +4661,7 @@ async function hotSwapToMWAProvider(config) {
|
|
|
4547
4661
|
}
|
|
4548
4662
|
currentAuthProvider = provider;
|
|
4549
4663
|
currentAuthMethod = 'mobile-wallet-adapter';
|
|
4664
|
+
currentAuthProviderConfigKey = authProviderConfigKey(Object.assign(Object.assign({}, config), { authMethod: 'mobile-wallet-adapter' }));
|
|
4550
4665
|
const coreConfig = await getConfig();
|
|
4551
4666
|
coreConfig.authProvider = provider;
|
|
4552
4667
|
// Send 'phantom' as authMethod so the server routes to Solana verification.
|
|
@@ -4557,12 +4672,18 @@ async function hotSwapToMWAProvider(config) {
|
|
|
4557
4672
|
}
|
|
4558
4673
|
async function getAuthProvider(config) {
|
|
4559
4674
|
var _a, _b;
|
|
4560
|
-
|
|
4675
|
+
const nextProviderConfigKey = config ? authProviderConfigKey(config) : null;
|
|
4676
|
+
if (currentAuthProvider && (!config || currentAuthProviderConfigKey === nextProviderConfigKey)) {
|
|
4561
4677
|
return currentAuthProvider;
|
|
4562
4678
|
}
|
|
4563
4679
|
if (!config) {
|
|
4564
4680
|
throw new Error("Config is required to initialize auth provider");
|
|
4565
4681
|
}
|
|
4682
|
+
if (currentAuthProvider && currentAuthProviderConfigKey !== nextProviderConfigKey) {
|
|
4683
|
+
currentAuthProvider = null;
|
|
4684
|
+
currentAuthMethod = null;
|
|
4685
|
+
currentAuthProviderConfigKey = null;
|
|
4686
|
+
}
|
|
4566
4687
|
initConfig = config;
|
|
4567
4688
|
const authMethod = config.authMethod;
|
|
4568
4689
|
if (!authMethod) {
|
|
@@ -4645,6 +4766,7 @@ async function getAuthProvider(config) {
|
|
|
4645
4766
|
console.log("[Offchain] Wrapping auth provider for Poofnet transaction tracking");
|
|
4646
4767
|
currentAuthProvider = new OffchainAuthProvider(currentAuthProvider);
|
|
4647
4768
|
}
|
|
4769
|
+
currentAuthProviderConfigKey = nextProviderConfigKey;
|
|
4648
4770
|
return currentAuthProvider;
|
|
4649
4771
|
}
|
|
4650
4772
|
/**
|
|
@@ -4674,6 +4796,7 @@ async function signInAnonymously() {
|
|
|
4674
4796
|
const provider = new GuestAuthProvider();
|
|
4675
4797
|
currentAuthProvider = provider;
|
|
4676
4798
|
currentAuthMethod = 'guest';
|
|
4799
|
+
currentAuthProviderConfigKey = 'direct:guest';
|
|
4677
4800
|
const coreConfig = await getConfig();
|
|
4678
4801
|
coreConfig.authProvider = provider;
|
|
4679
4802
|
coreConfig.authMethod = 'guest';
|
|
@@ -4718,6 +4841,7 @@ async function loginWithPrivy(options) {
|
|
|
4718
4841
|
provider = new OffchainAuthProvider(provider);
|
|
4719
4842
|
}
|
|
4720
4843
|
currentAuthProvider = provider;
|
|
4844
|
+
currentAuthProviderConfigKey = authProviderConfigKey(Object.assign(Object.assign({}, coreConfig), { authMethod: currentAuthMethod }));
|
|
4721
4845
|
coreConfig.authProvider = provider;
|
|
4722
4846
|
coreConfig.authMethod = currentAuthMethod;
|
|
4723
4847
|
setAuthProviderInstance(provider);
|
|
@@ -4734,6 +4858,7 @@ async function activateEmailProvider() {
|
|
|
4734
4858
|
const provider = new EmailAuthProvider();
|
|
4735
4859
|
currentAuthProvider = provider;
|
|
4736
4860
|
currentAuthMethod = 'email';
|
|
4861
|
+
currentAuthProviderConfigKey = 'direct:email';
|
|
4737
4862
|
const coreConfig = await getConfig();
|
|
4738
4863
|
coreConfig.authProvider = provider;
|
|
4739
4864
|
coreConfig.authMethod = 'email';
|
|
@@ -4860,6 +4985,7 @@ async function logout$1() {
|
|
|
4860
4985
|
setStoredAuthMethod(null);
|
|
4861
4986
|
currentAuthProvider = null;
|
|
4862
4987
|
currentAuthMethod = null;
|
|
4988
|
+
currentAuthProviderConfigKey = null;
|
|
4863
4989
|
}
|
|
4864
4990
|
|
|
4865
4991
|
/**
|
|
@@ -5507,4 +5633,4 @@ class PrivyExpoProvider {
|
|
|
5507
5633
|
}
|
|
5508
5634
|
|
|
5509
5635
|
export { loginWithRedirect as A, linkWithRedirect as B, completeLoginFromRedirect as C, loginWithPopup as D, completeLoginInPopup as E, useAuth as F, deserializeTransaction as G, getIdToken as H, setPlatform as I, index as J, OffchainAuthProvider as O, PrivyExpoProvider as P, SURFNET_RPC_URL as S, detectAndroid as a, bufferExports as b, confirmAndCheckTransaction as c, detectMobile as d, setAuthLoading as e, resolveSolanaWalletStandardChain as f, getPlatform as g, bs58 as h, init as i, getCurrentUser as j, onAuthLoadingChanged as k, getAuthLoading as l, login as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, logout as p, getAuthProvider as q, resolveSolanaRpcUrl as r, setCurrentUser as s, signInAnonymously as t, sendEmailOtp as u, sendTextOtp as v, verifyEmailOtp as w, verifyTextOtp as x, linkEmail as y, loginWithPrivy as z };
|
|
5510
|
-
//# sourceMappingURL=index.native-
|
|
5636
|
+
//# sourceMappingURL=index.native-C9PMGtxX.mjs.map
|