@bounded-sh/client 0.0.24 → 0.0.25
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/auth/oidc-auth.d.ts +31 -10
- package/dist/index.js +163 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +163 -69
- package/dist/index.mjs.map +1 -1
- package/dist/{index.native-D1YQ-LU7.mjs → index.native-CcpKp_mg.mjs} +167 -73
- package/dist/index.native-CcpKp_mg.mjs.map +1 -0
- package/dist/{index.native-DcetyeOb.js → index.native-DIw0cB5C.js} +167 -73
- package/dist/index.native-DIw0cB5C.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{phantom-wallet-provider-DgBk6o3j.js → phantom-wallet-provider-Cagl3roP.js} +2 -2
- package/dist/{phantom-wallet-provider-DgBk6o3j.js.map → phantom-wallet-provider-Cagl3roP.js.map} +1 -1
- package/dist/{phantom-wallet-provider-3_IulJlh.mjs → phantom-wallet-provider-CyMav6HM.mjs} +2 -2
- package/dist/{phantom-wallet-provider-3_IulJlh.mjs.map → phantom-wallet-provider-CyMav6HM.mjs.map} +1 -1
- package/dist/platform.d.ts +8 -0
- package/dist/{privy-wallet-provider-DNvtYCsQ.js → privy-wallet-provider-Cb1GUmOi.js} +3 -3
- package/dist/{privy-wallet-provider-DNvtYCsQ.js.map → privy-wallet-provider-Cb1GUmOi.js.map} +1 -1
- package/dist/{privy-wallet-provider-DQtXFGFF.mjs → privy-wallet-provider-YR9Eisgl.mjs} +3 -3
- package/dist/{privy-wallet-provider-DQtXFGFF.mjs.map → privy-wallet-provider-YR9Eisgl.mjs.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-CcnkDdgZ.js → solana-mobile-wallet-provider-BEpjk4Sz.js} +2 -2
- package/dist/{solana-mobile-wallet-provider-CcnkDdgZ.js.map → solana-mobile-wallet-provider-BEpjk4Sz.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-DE_zCpKE.mjs → solana-mobile-wallet-provider-DOSBGM8C.mjs} +2 -2
- package/dist/{solana-mobile-wallet-provider-DE_zCpKE.mjs.map → solana-mobile-wallet-provider-DOSBGM8C.mjs.map} +1 -1
- package/package.json +10 -2
- package/dist/index.native-D1YQ-LU7.mjs.map +0 -1
- package/dist/index.native-DcetyeOb.js.map +0 -1
|
@@ -67,6 +67,17 @@ function createWebPlatform() {
|
|
|
67
67
|
const hash = createHash('sha256').update(data).digest();
|
|
68
68
|
return hash.buffer.slice(hash.byteOffset, hash.byteOffset + hash.byteLength);
|
|
69
69
|
},
|
|
70
|
+
getRandomBytes(length) {
|
|
71
|
+
const out = new Uint8Array(length);
|
|
72
|
+
const g = typeof globalThis !== 'undefined' ? globalThis : undefined;
|
|
73
|
+
if (g && g.crypto && typeof g.crypto.getRandomValues === 'function') {
|
|
74
|
+
g.crypto.getRandomValues(out);
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
throw new Error('No secure random source available for PKCE. On React Native, either import ' +
|
|
78
|
+
"'react-native-get-random-values' once at your app entry, or pass getRandomBytes " +
|
|
79
|
+
'via setPlatform({ getRandomBytes }) (e.g. expo-crypto getRandomBytes).');
|
|
80
|
+
},
|
|
70
81
|
getUserAgent() {
|
|
71
82
|
if (hasWindow && typeof navigator !== 'undefined')
|
|
72
83
|
return navigator.userAgent;
|
|
@@ -4234,24 +4245,27 @@ async function issuerBase() {
|
|
|
4234
4245
|
const cfg = await getConfig();
|
|
4235
4246
|
return (cfg.humanAuthApiUrl || 'https://auth.bounded.sh').replace(/\/$/, '');
|
|
4236
4247
|
}
|
|
4248
|
+
// Base64url-encode raw bytes via the platform abstraction (web: window.btoa;
|
|
4249
|
+
// RN/Node: the polyfilled/Buffer btoa supplied by getPlatform()). On web this is
|
|
4250
|
+
// byte-identical to the previous direct `btoa(...)` call.
|
|
4237
4251
|
function b64url(buf) {
|
|
4238
4252
|
let s = '';
|
|
4239
|
-
const bytes = new Uint8Array(buf);
|
|
4253
|
+
const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);
|
|
4240
4254
|
for (let i = 0; i < bytes.length; i++)
|
|
4241
4255
|
s += String.fromCharCode(bytes[i]);
|
|
4242
|
-
return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
4256
|
+
return getPlatform().btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
4243
4257
|
}
|
|
4258
|
+
// PKCE verifier + S256 challenge, fully platform-neutral: random bytes and the
|
|
4259
|
+
// SHA-256 digest both come from getPlatform() (web → WebCrypto, RN → polyfill/
|
|
4260
|
+
// expo-crypto). Web output is identical to the previous raw-crypto path.
|
|
4244
4261
|
async function makePkce() {
|
|
4245
|
-
const rnd =
|
|
4246
|
-
|
|
4247
|
-
const
|
|
4248
|
-
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(verifier));
|
|
4262
|
+
const rnd = getPlatform().getRandomBytes(32);
|
|
4263
|
+
const verifier = b64url(rnd);
|
|
4264
|
+
const digest = await getPlatform().sha256(getPlatform().textEncode(verifier));
|
|
4249
4265
|
return { verifier, challenge: b64url(digest) };
|
|
4250
4266
|
}
|
|
4251
4267
|
function randomState() {
|
|
4252
|
-
|
|
4253
|
-
crypto.getRandomValues(rnd);
|
|
4254
|
-
return b64url(rnd.buffer);
|
|
4268
|
+
return b64url(getPlatform().getRandomBytes(16));
|
|
4255
4269
|
}
|
|
4256
4270
|
function normalizeMethod(value) {
|
|
4257
4271
|
const normalized = String(value || '').trim().toLowerCase();
|
|
@@ -4268,83 +4282,166 @@ function appendHostedLoginHints(params, opts) {
|
|
|
4268
4282
|
if (provider)
|
|
4269
4283
|
params.set('bounded_provider', provider);
|
|
4270
4284
|
}
|
|
4271
|
-
|
|
4285
|
+
// Build the authorize URL + the PKCE state that pairs with it. PURE: no storage,
|
|
4286
|
+
// no navigation — so it's shared verbatim by the web redirect/popup paths and the
|
|
4287
|
+
// native (expo-web-browser) path. The caller decides where the PkceState lives
|
|
4288
|
+
// (web → sessionStorage across the full-page redirect; native → in-memory across
|
|
4289
|
+
// the awaited browser session).
|
|
4290
|
+
async function buildAuthorize(opts, guestHint) {
|
|
4272
4291
|
const cfg = await getConfig();
|
|
4273
4292
|
if (!cfg.appId)
|
|
4274
4293
|
throw new Error('appId is not configured (init the SDK with your appId)');
|
|
4275
4294
|
const redirectUri = opts.redirectUri;
|
|
4276
4295
|
const { verifier, challenge } = await makePkce();
|
|
4277
4296
|
const state = randomState();
|
|
4278
|
-
// Stash the verifier + state so the redirect_uri page can finish the exchange. sessionStorage
|
|
4279
|
-
// is per-tab and cleared on close — appropriate for a short-lived auth handshake.
|
|
4280
|
-
sessionStorage.setItem(PKCE_STORE_KEY, JSON.stringify({ verifier, state, redirectUri }));
|
|
4281
4297
|
const base = await issuerBase();
|
|
4282
4298
|
const params = new URLSearchParams({
|
|
4283
4299
|
client_id: cfg.appId, redirect_uri: redirectUri, response_type: 'code', scope: 'openid profile email',
|
|
4284
4300
|
code_challenge: challenge, code_challenge_method: 'S256', state,
|
|
4285
4301
|
});
|
|
4286
4302
|
appendHostedLoginHints(params, opts);
|
|
4287
|
-
|
|
4303
|
+
// Anonymous→real UPGRADE (linkWithRedirect): carry the guest's signed id-token THROUGH
|
|
4304
|
+
// the authorize request as a hint. The issuer signature-verifies it and binds it to this
|
|
4305
|
+
// request's PKCE code_challenge, so the link is completed single-use during the normal
|
|
4306
|
+
// code→token exchange — no retired /link/social, and the appId stays bound to client_id.
|
|
4307
|
+
if (guestHint)
|
|
4308
|
+
params.set('bounded_guest_hint', guestHint);
|
|
4309
|
+
return { url: `${base}/api/auth/oauth2/authorize?${params.toString()}`, pkce: { verifier, state, redirectUri } };
|
|
4310
|
+
}
|
|
4311
|
+
// Are we on React Native (no DOM)? OIDC dispatch uses this to choose the native
|
|
4312
|
+
// expo-web-browser driver vs. the web full-page-redirect/popup driver.
|
|
4313
|
+
function isNative() {
|
|
4314
|
+
return !getPlatform().hasDOM;
|
|
4315
|
+
}
|
|
4316
|
+
// ---------------------------------------------------------------------------
|
|
4317
|
+
// Native (React Native / Expo) redirect driver
|
|
4318
|
+
// ---------------------------------------------------------------------------
|
|
4319
|
+
// Lazily load expo-web-browser. It's an OPTIONAL peer dep — imported dynamically
|
|
4320
|
+
// so the web/Node bundle never requires it. Throws an actionable error if a native
|
|
4321
|
+
// app calls hosted login without installing it.
|
|
4322
|
+
async function loadExpoWebBrowser() {
|
|
4323
|
+
try {
|
|
4324
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
4325
|
+
return await import('expo-web-browser');
|
|
4326
|
+
}
|
|
4327
|
+
catch (_a) {
|
|
4328
|
+
throw new Error('React Native hosted login requires the optional peer dependency "expo-web-browser". ' +
|
|
4329
|
+
'Install it with `npx expo install expo-web-browser` (and `expo-crypto`), then retry.');
|
|
4330
|
+
}
|
|
4288
4331
|
}
|
|
4289
|
-
|
|
4290
|
-
|
|
4332
|
+
// Parse code/state out of the universal-link callback URL. Hand-rolled (no `new URL()`)
|
|
4333
|
+
// because React Native's URL implementation is non-spec-compliant for query parsing.
|
|
4334
|
+
function parseCallbackParams(callbackUrl) {
|
|
4335
|
+
var _a, _b;
|
|
4336
|
+
const qIndex = callbackUrl.indexOf('?');
|
|
4337
|
+
if (qIndex < 0)
|
|
4338
|
+
return { code: null, state: null };
|
|
4339
|
+
const query = callbackUrl.slice(qIndex + 1).split('#')[0];
|
|
4340
|
+
const out = {};
|
|
4341
|
+
for (const part of query.split('&')) {
|
|
4342
|
+
if (!part)
|
|
4343
|
+
continue;
|
|
4344
|
+
const eq = part.indexOf('=');
|
|
4345
|
+
const k = eq < 0 ? part : part.slice(0, eq);
|
|
4346
|
+
const v = eq < 0 ? '' : part.slice(eq + 1);
|
|
4347
|
+
try {
|
|
4348
|
+
out[decodeURIComponent(k)] = decodeURIComponent(v.replace(/\+/g, ' '));
|
|
4349
|
+
}
|
|
4350
|
+
catch (_c) {
|
|
4351
|
+
out[k] = v;
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
return { code: (_a = out['code']) !== null && _a !== void 0 ? _a : null, state: (_b = out['state']) !== null && _b !== void 0 ? _b : null };
|
|
4355
|
+
}
|
|
4356
|
+
// Full native login: open the hosted page in the system auth session, await the
|
|
4357
|
+
// universal-link callback, verify state, and run the SAME PKCE code→token exchange
|
|
4358
|
+
// as web. Returns the signed-in User (native completes inline — there's no separate
|
|
4359
|
+
// completeLoginFromRedirect() round-trip the way the web full-page redirect needs).
|
|
4360
|
+
async function runNativeLogin(opts, guestHint) {
|
|
4361
|
+
var _a, _b;
|
|
4362
|
+
const { url, pkce } = await buildAuthorize(opts, guestHint);
|
|
4363
|
+
const WebBrowser = await loadExpoWebBrowser();
|
|
4364
|
+
const openAuthSession = WebBrowser.openAuthSessionAsync || ((_a = WebBrowser.default) === null || _a === void 0 ? void 0 : _a.openAuthSessionAsync);
|
|
4365
|
+
if (typeof openAuthSession !== 'function') {
|
|
4366
|
+
throw new Error('expo-web-browser.openAuthSessionAsync is unavailable — update expo-web-browser.');
|
|
4367
|
+
}
|
|
4368
|
+
setAuthLoading(true);
|
|
4369
|
+
try {
|
|
4370
|
+
// openAuthSessionAsync keeps JS alive while the system browser is shown, then
|
|
4371
|
+
// resolves with the callback URL once the universal link fires — so `pkce`
|
|
4372
|
+
// stays in scope and never needs to be persisted.
|
|
4373
|
+
const result = await openAuthSession(url, opts.redirectUri);
|
|
4374
|
+
if (!result || result.type === 'cancel' || result.type === 'dismiss') {
|
|
4375
|
+
throw new Error('Login cancelled');
|
|
4376
|
+
}
|
|
4377
|
+
if (result.type !== 'success' || typeof result.url !== 'string') {
|
|
4378
|
+
throw new Error(`Hosted login did not complete (result: ${(_b = result === null || result === void 0 ? void 0 : result.type) !== null && _b !== void 0 ? _b : 'unknown'})`);
|
|
4379
|
+
}
|
|
4380
|
+
const { code, state: returnedState } = parseCallbackParams(result.url);
|
|
4381
|
+
if (!code)
|
|
4382
|
+
throw new Error('No authorization code in the callback URL');
|
|
4383
|
+
if (!returnedState || returnedState !== pkce.state) {
|
|
4384
|
+
throw new Error('OAuth state mismatch — possible CSRF; aborting');
|
|
4385
|
+
}
|
|
4386
|
+
return await exchangeCode(code, pkce.verifier, pkce.redirectUri);
|
|
4387
|
+
}
|
|
4388
|
+
finally {
|
|
4389
|
+
setAuthLoading(false);
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
/** Start hosted login (Google / Apple / email / hosted phone). Works on WEB and REACT NATIVE.
|
|
4393
|
+
*
|
|
4394
|
+
* WEB: navigates the whole page to the hosted Bounded login and resolves (void) as the page
|
|
4395
|
+
* unloads; on return to `redirectUri?code=...` you call completeLoginFromRedirect().
|
|
4396
|
+
*
|
|
4397
|
+
* REACT NATIVE: opens the hosted page via expo-web-browser, awaits the https universal-link
|
|
4398
|
+
* callback, runs the PKCE exchange INLINE, and resolves with the signed-in User. No
|
|
4399
|
+
* completeLoginFromRedirect() call is needed on native. Requires `redirectUri` to be an
|
|
4400
|
+
* https UNIVERSAL LINK whose origin the app owner registered in the app's allowedOrigins
|
|
4401
|
+
* (custom `myapp://` schemes are rejected by the issuer). Needs the optional peer deps
|
|
4402
|
+
* expo-web-browser + (expo-crypto or react-native-get-random-values). */
|
|
4291
4403
|
async function loginWithRedirect(opts) {
|
|
4404
|
+
if (isNative())
|
|
4405
|
+
return runNativeLogin(opts);
|
|
4292
4406
|
if (!hasDOM())
|
|
4293
|
-
throw new Error('loginWithRedirect
|
|
4294
|
-
const url = await
|
|
4407
|
+
throw new Error('loginWithRedirect requires a browser or a configured React Native platform');
|
|
4408
|
+
const { url, pkce } = await buildAuthorize(opts);
|
|
4409
|
+
// Stash the verifier + state so the redirect_uri page can finish the exchange. sessionStorage
|
|
4410
|
+
// is per-tab and cleared on close — appropriate for a short-lived auth handshake.
|
|
4411
|
+
sessionStorage.setItem(PKCE_STORE_KEY, JSON.stringify(pkce));
|
|
4295
4412
|
window.location.href = url;
|
|
4296
4413
|
}
|
|
4297
|
-
const LINK_GUEST_KEY = 'bounded.link.guest';
|
|
4298
4414
|
/** UPGRADE the current anonymous (guest) session by linking a SOCIAL/redirect login
|
|
4299
|
-
* (e.g. Google) — Firebase `linkWithPopup`/redirect parity.
|
|
4300
|
-
*
|
|
4301
|
-
*
|
|
4302
|
-
*
|
|
4415
|
+
* (e.g. Google) — Firebase `linkWithPopup`/redirect parity. Carries the guest's signed
|
|
4416
|
+
* id-token THROUGH the OIDC authorize request (as a single-use hint bound to the PKCE
|
|
4417
|
+
* challenge), then runs the normal redirect login. The issuer completes the link during
|
|
4418
|
+
* the standard code→token exchange: if the chosen account is brand-new the guest's
|
|
4419
|
+
* `@user.id` is preserved (the returned id_token is minted under it), else the account
|
|
4420
|
+
* stays separate (guest id discarded). Requires an active guest session.
|
|
4421
|
+
*
|
|
4422
|
+
* Works on WEB (navigates, finish with completeLoginFromRedirect) and REACT NATIVE
|
|
4423
|
+
* (opens expo-web-browser and resolves with the upgraded User inline). */
|
|
4303
4424
|
async function linkWithRedirect(opts) {
|
|
4304
|
-
if (!hasDOM())
|
|
4305
|
-
throw new Error('linkWithRedirect is web-only');
|
|
4306
4425
|
const guestToken = sessionManager().getIdToken();
|
|
4307
4426
|
if (!guestToken)
|
|
4308
4427
|
throw new Error('linkWithRedirect requires an active anonymous session — call signInAnonymously() first.');
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
window.location.href = url;
|
|
4312
|
-
}
|
|
4313
|
-
// If a guest-link is pending (linkWithRedirect stashed a guest token before this
|
|
4314
|
-
// redirect), exchange it + the fresh social token for an UPGRADED token via
|
|
4315
|
-
// /link/social and replace the session. Returns the upgraded user, or null if no
|
|
4316
|
-
// link was pending / the link failed (in which case the plain social login stands).
|
|
4317
|
-
async function finishGuestLinkIfPending(socialIdToken) {
|
|
4428
|
+
if (isNative())
|
|
4429
|
+
return runNativeLogin(opts, guestToken);
|
|
4318
4430
|
if (!hasDOM())
|
|
4319
|
-
|
|
4320
|
-
const
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
sessionStorage.removeItem(LINK_GUEST_KEY);
|
|
4324
|
-
try {
|
|
4325
|
-
const cfg = await getConfig();
|
|
4326
|
-
const base = await issuerBase();
|
|
4327
|
-
const res = await fetch(`${base}/link/social`, {
|
|
4328
|
-
method: 'POST', headers: { 'content-type': 'application/json' },
|
|
4329
|
-
body: JSON.stringify({ appId: cfg.appId, guestToken, socialToken: socialIdToken }),
|
|
4330
|
-
});
|
|
4331
|
-
const data = await res.json().catch(() => null);
|
|
4332
|
-
const idToken = tokenField(data, 'id_token', 'idToken');
|
|
4333
|
-
if (!res.ok || !idToken)
|
|
4334
|
-
return null; // link failed -> keep the plain social session
|
|
4335
|
-
const upgraded = userFromIdToken(idToken);
|
|
4336
|
-
const accessToken = tokenField(data, 'access_token', 'accessToken') || idToken;
|
|
4337
|
-
const refreshToken = boundedRefreshTokenField(data);
|
|
4338
|
-
await sessionManager().storeSession(String(upgraded.address || ''), accessToken, idToken, refreshToken, base);
|
|
4339
|
-
setCurrentUser(upgraded);
|
|
4340
|
-
return upgraded;
|
|
4341
|
-
}
|
|
4342
|
-
catch (_a) {
|
|
4343
|
-
return null;
|
|
4344
|
-
}
|
|
4431
|
+
throw new Error('linkWithRedirect requires a browser or a configured React Native platform');
|
|
4432
|
+
const { url, pkce } = await buildAuthorize(opts, guestToken);
|
|
4433
|
+
sessionStorage.setItem(PKCE_STORE_KEY, JSON.stringify(pkce));
|
|
4434
|
+
window.location.href = url;
|
|
4345
4435
|
}
|
|
4346
|
-
/** Finish login on the redirect_uri page: exchange ?code= for a token (PKCE-verified),
|
|
4347
|
-
* the session, and return the User. Idempotent: returns null if there's no ?code= in the URL.
|
|
4436
|
+
/** Finish login on the redirect_uri page (WEB ONLY): exchange ?code= for a token (PKCE-verified),
|
|
4437
|
+
* store the session, and return the User. Idempotent: returns null if there's no ?code= in the URL.
|
|
4438
|
+
* When the redirect was a guest UPGRADE (linkWithRedirect) and the issuer adopted the guest
|
|
4439
|
+
* id, the exchanged id_token already carries the preserved `@user.id`, so the returned User
|
|
4440
|
+
* reflects it automatically (no extra round-trip).
|
|
4441
|
+
*
|
|
4442
|
+
* On REACT NATIVE this returns null and is a no-op: native login completes INLINE inside
|
|
4443
|
+
* loginWithRedirect()/linkWithRedirect() (which resolve with the User), so there is no
|
|
4444
|
+
* separate redirect page to finish from. Calling it on RN is harmless. */
|
|
4348
4445
|
async function completeLoginFromRedirect() {
|
|
4349
4446
|
if (!hasDOM())
|
|
4350
4447
|
return null;
|
|
@@ -4363,15 +4460,11 @@ async function completeLoginFromRedirect() {
|
|
|
4363
4460
|
throw new Error('OAuth state mismatch — possible CSRF; aborting');
|
|
4364
4461
|
const user = await exchangeCode(code, pkce.verifier, pkce.redirectUri);
|
|
4365
4462
|
sessionStorage.removeItem(PKCE_STORE_KEY);
|
|
4366
|
-
// If this redirect was a guest UPGRADE (linkWithRedirect), finish the link now:
|
|
4367
|
-
// swap the fresh social session for one minted under the guest's preserved id.
|
|
4368
|
-
const socialIdToken = sessionManager().getIdToken();
|
|
4369
|
-
const upgraded = socialIdToken ? await finishGuestLinkIfPending(socialIdToken) : null;
|
|
4370
4463
|
// Strip code/state from the URL so a reload doesn't re-exchange (codes are single-use anyway).
|
|
4371
4464
|
url.searchParams.delete('code');
|
|
4372
4465
|
url.searchParams.delete('state');
|
|
4373
4466
|
window.history.replaceState({}, document.title, url.pathname + url.search + url.hash);
|
|
4374
|
-
return
|
|
4467
|
+
return user;
|
|
4375
4468
|
}
|
|
4376
4469
|
finally {
|
|
4377
4470
|
setAuthLoading(false);
|
|
@@ -4381,8 +4474,9 @@ async function completeLoginFromRedirect() {
|
|
|
4381
4474
|
* redirect_uri page posts the code back. The redirect_uri page must call completeLoginInPopup(). */
|
|
4382
4475
|
async function loginWithPopup(opts) {
|
|
4383
4476
|
if (!hasDOM())
|
|
4384
|
-
throw new Error('loginWithPopup is web-only');
|
|
4385
|
-
const url = await
|
|
4477
|
+
throw new Error('loginWithPopup is web-only — on React Native use loginWithRedirect()');
|
|
4478
|
+
const { url, pkce } = await buildAuthorize(opts);
|
|
4479
|
+
sessionStorage.setItem(PKCE_STORE_KEY, JSON.stringify(pkce));
|
|
4386
4480
|
const w = opts.width || 480, h = opts.height || 720;
|
|
4387
4481
|
const left = window.screenX + (window.outerWidth - w) / 2;
|
|
4388
4482
|
const top = window.screenY + (window.outerHeight - h) / 2;
|
|
@@ -4589,17 +4683,17 @@ function clearIncompatibleSession() {
|
|
|
4589
4683
|
// Lazy loaders for web-only providers.
|
|
4590
4684
|
// Using dynamic import() ensures Metro (RN) never resolves these modules.
|
|
4591
4685
|
async function loadPhantomWalletProvider() {
|
|
4592
|
-
const mod = await import('./phantom-wallet-provider-
|
|
4686
|
+
const mod = await import('./phantom-wallet-provider-CyMav6HM.mjs');
|
|
4593
4687
|
return { PhantomWalletProvider: mod.PhantomWalletProvider };
|
|
4594
4688
|
}
|
|
4595
4689
|
// Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
|
|
4596
4690
|
// never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
|
|
4597
4691
|
async function loadPrivyWalletProvider() {
|
|
4598
|
-
const mod = await import('./privy-wallet-provider-
|
|
4692
|
+
const mod = await import('./privy-wallet-provider-YR9Eisgl.mjs');
|
|
4599
4693
|
return mod.PrivyWalletProvider;
|
|
4600
4694
|
}
|
|
4601
4695
|
async function loadSolanaMobileWalletProvider() {
|
|
4602
|
-
const mod = await import('./solana-mobile-wallet-provider-
|
|
4696
|
+
const mod = await import('./solana-mobile-wallet-provider-DOSBGM8C.mjs');
|
|
4603
4697
|
return mod.SolanaMobileWalletProvider;
|
|
4604
4698
|
}
|
|
4605
4699
|
function requireWebPrivyConfig(config) {
|
|
@@ -5641,4 +5735,4 @@ class PrivyExpoProvider {
|
|
|
5641
5735
|
}
|
|
5642
5736
|
|
|
5643
5737
|
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 };
|
|
5644
|
-
//# sourceMappingURL=index.native-
|
|
5738
|
+
//# sourceMappingURL=index.native-CcpKp_mg.mjs.map
|