@bounded-sh/client 0.0.22 → 0.0.23
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 +24 -17
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{index.native-C9PMGtxX.mjs → index.native-D1YQ-LU7.mjs} +14 -6
- package/dist/index.native-D1YQ-LU7.mjs.map +1 -0
- package/dist/{index.native-C4a8IUpM.js → index.native-DcetyeOb.js} +14 -6
- package/dist/index.native-DcetyeOb.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{phantom-wallet-provider-DhpV9xKE.mjs → phantom-wallet-provider-3_IulJlh.mjs} +2 -2
- package/dist/{phantom-wallet-provider-DhpV9xKE.mjs.map → phantom-wallet-provider-3_IulJlh.mjs.map} +1 -1
- package/dist/{phantom-wallet-provider-BPRRcIaN.js → phantom-wallet-provider-DgBk6o3j.js} +2 -2
- package/dist/{phantom-wallet-provider-BPRRcIaN.js.map → phantom-wallet-provider-DgBk6o3j.js.map} +1 -1
- package/dist/{privy-wallet-provider-D4W91sqG.js → privy-wallet-provider-DNvtYCsQ.js} +3 -3
- package/dist/{privy-wallet-provider-D4W91sqG.js.map → privy-wallet-provider-DNvtYCsQ.js.map} +1 -1
- package/dist/{privy-wallet-provider-B6QyPXqq.mjs → privy-wallet-provider-DQtXFGFF.mjs} +3 -3
- package/dist/{privy-wallet-provider-B6QyPXqq.mjs.map → privy-wallet-provider-DQtXFGFF.mjs.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-B0O0BctB.js → solana-mobile-wallet-provider-CcnkDdgZ.js} +2 -2
- package/dist/{solana-mobile-wallet-provider-B0O0BctB.js.map → solana-mobile-wallet-provider-CcnkDdgZ.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-OGKifgCZ.mjs → solana-mobile-wallet-provider-DE_zCpKE.mjs} +2 -2
- package/dist/{solana-mobile-wallet-provider-OGKifgCZ.mjs.map → solana-mobile-wallet-provider-DE_zCpKE.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/index.native-C4a8IUpM.js.map +0 -1
- package/dist/index.native-C9PMGtxX.mjs.map +0 -1
|
@@ -4244,6 +4244,14 @@ function tokenField(data, snake, camel) {
|
|
|
4244
4244
|
const value = (_a = data === null || data === void 0 ? void 0 : data[snake]) !== null && _a !== void 0 ? _a : data === null || data === void 0 ? void 0 : data[camel];
|
|
4245
4245
|
return typeof value === 'string' ? value : '';
|
|
4246
4246
|
}
|
|
4247
|
+
function boundedRefreshTokenField(data) {
|
|
4248
|
+
for (const key of ['bounded_refresh_token', 'boundedRefreshToken', 'refreshToken']) {
|
|
4249
|
+
const value = data === null || data === void 0 ? void 0 : data[key];
|
|
4250
|
+
if (typeof value === 'string' && value.length > 0)
|
|
4251
|
+
return value;
|
|
4252
|
+
}
|
|
4253
|
+
return '';
|
|
4254
|
+
}
|
|
4247
4255
|
async function issuerBase() {
|
|
4248
4256
|
const cfg = await core.getConfig();
|
|
4249
4257
|
return (cfg.humanAuthApiUrl || 'https://auth.bounded.sh').replace(/\/$/, '');
|
|
@@ -4348,7 +4356,7 @@ async function finishGuestLinkIfPending(socialIdToken) {
|
|
|
4348
4356
|
return null; // link failed -> keep the plain social session
|
|
4349
4357
|
const upgraded = userFromIdToken(idToken);
|
|
4350
4358
|
const accessToken = tokenField(data, 'access_token', 'accessToken') || idToken;
|
|
4351
|
-
const refreshToken =
|
|
4359
|
+
const refreshToken = boundedRefreshTokenField(data);
|
|
4352
4360
|
await sessionManager().storeSession(String(upgraded.address || ''), accessToken, idToken, refreshToken, base);
|
|
4353
4361
|
setCurrentUser(upgraded);
|
|
4354
4362
|
return upgraded;
|
|
@@ -4489,7 +4497,7 @@ async function exchangeCode(code, verifier, redirectUri) {
|
|
|
4489
4497
|
if (!idToken)
|
|
4490
4498
|
throw new Error('No id_token returned from the token endpoint');
|
|
4491
4499
|
const accessToken = tokenField(data, 'access_token', 'accessToken') || idToken;
|
|
4492
|
-
const refreshToken =
|
|
4500
|
+
const refreshToken = boundedRefreshTokenField(data);
|
|
4493
4501
|
const user = userFromIdToken(idToken);
|
|
4494
4502
|
await sessionManager().storeSession(String(user.address || ''), accessToken, idToken, refreshToken, base);
|
|
4495
4503
|
try {
|
|
@@ -4603,17 +4611,17 @@ function clearIncompatibleSession() {
|
|
|
4603
4611
|
// Lazy loaders for web-only providers.
|
|
4604
4612
|
// Using dynamic import() ensures Metro (RN) never resolves these modules.
|
|
4605
4613
|
async function loadPhantomWalletProvider() {
|
|
4606
|
-
const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-
|
|
4614
|
+
const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-DgBk6o3j.js'); });
|
|
4607
4615
|
return { PhantomWalletProvider: mod.PhantomWalletProvider };
|
|
4608
4616
|
}
|
|
4609
4617
|
// Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
|
|
4610
4618
|
// never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
|
|
4611
4619
|
async function loadPrivyWalletProvider() {
|
|
4612
|
-
const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-
|
|
4620
|
+
const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-DNvtYCsQ.js'); });
|
|
4613
4621
|
return mod.PrivyWalletProvider;
|
|
4614
4622
|
}
|
|
4615
4623
|
async function loadSolanaMobileWalletProvider() {
|
|
4616
|
-
const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-
|
|
4624
|
+
const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-CcnkDdgZ.js'); });
|
|
4617
4625
|
return mod.SolanaMobileWalletProvider;
|
|
4618
4626
|
}
|
|
4619
4627
|
function requireWebPrivyConfig(config) {
|
|
@@ -5693,4 +5701,4 @@ exports.signInAnonymously = signInAnonymously;
|
|
|
5693
5701
|
exports.useAuth = useAuth;
|
|
5694
5702
|
exports.verifyEmailOtp = verifyEmailOtp;
|
|
5695
5703
|
exports.verifyTextOtp = verifyTextOtp;
|
|
5696
|
-
//# sourceMappingURL=index.native-
|
|
5704
|
+
//# sourceMappingURL=index.native-DcetyeOb.js.map
|