@tempoxyz/id 0.0.0-pr-704.sha-7c2e350 → 0.0.0-pr-708.sha-bb6f1e1
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/{Connections-6BMLTJRD.js → Connections-7J5I4L3Q.js} +2 -2
- package/dist/{Sheet-EWEYRZNJ.js → Sheet-PTAFRAX2.js} +1 -1
- package/dist/{chunk-BWC6KR4N.js → chunk-FDHRRJQI.js} +1 -1
- package/dist/{chunk-FR3Y7557.js → chunk-JJT3ITRO.js} +1 -1
- package/dist/{chunk-N2AX3I52.js → chunk-YDYAVOWG.js} +58 -161
- package/dist/commands/login.js +3 -3
- package/dist/commands/logout.js +3 -3
- package/dist/commands/whoami.js +3 -3
- package/dist/{dialog-B3MKOMPT.js → dialog-7DSDKEHU.js} +1 -1
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
var Accounts_exports = {};
|
|
20
20
|
__export(Accounts_exports, {
|
|
21
21
|
ChainUnavailableError: () => ChainUnavailableError,
|
|
22
|
+
ChallengeWithoutKeyError: () => ChallengeWithoutKeyError,
|
|
22
23
|
ClientIdRequiredError: () => ClientIdRequiredError,
|
|
23
24
|
ConnectionsRequiredError: () => ConnectionsRequiredError,
|
|
24
25
|
EverywhereNotAllowedError: () => EverywhereNotAllowedError,
|
|
@@ -232,26 +233,10 @@ function authorization(body, options) {
|
|
|
232
233
|
return {
|
|
233
234
|
...tokens_,
|
|
234
235
|
accessKey: toAccount(key, { accessKey: accessKey2 }),
|
|
235
|
-
...challengeSignature(body, { challenged: options.challenged }),
|
|
236
236
|
key,
|
|
237
237
|
user: user(tokens_)
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function challengeSignature(body, options = {}) {
|
|
241
|
-
if (body.account && body.challenge_signature)
|
|
242
|
-
return {
|
|
243
|
-
address: body.account,
|
|
244
|
-
challengeSignature: body.challenge_signature
|
|
245
|
-
};
|
|
246
|
-
if (options.challenged)
|
|
247
|
-
throw new RequestError({
|
|
248
|
-
code: "server_error",
|
|
249
|
-
message: "Missing challenge signature in the response to a request with a challenge. Update Tempo ID, or sign in without the challenge.",
|
|
250
|
-
signedIn: true,
|
|
251
|
-
status: 200
|
|
252
|
-
});
|
|
253
|
-
return {};
|
|
254
|
-
}
|
|
255
240
|
async function json(response) {
|
|
256
241
|
const body = await response.json().catch(() => ({}));
|
|
257
242
|
if (!response.ok) throw error(body, { status: response.status });
|
|
@@ -488,13 +473,9 @@ function signedIn(error3, options = {}) {
|
|
|
488
473
|
uri: error3.uri
|
|
489
474
|
});
|
|
490
475
|
}
|
|
491
|
-
function withoutKey(body
|
|
476
|
+
function withoutKey(body) {
|
|
492
477
|
const tokens_ = "accessToken" in body.tokens ? body.tokens : tokens(body.tokens);
|
|
493
|
-
return {
|
|
494
|
-
...tokens_,
|
|
495
|
-
...challengeSignature(body, options),
|
|
496
|
-
user: user(tokens_)
|
|
497
|
-
};
|
|
478
|
+
return { ...tokens_, user: user(tokens_) };
|
|
498
479
|
}
|
|
499
480
|
|
|
500
481
|
// ../../accounts/src/actions/account.ts
|
|
@@ -960,12 +941,13 @@ function seconds(options) {
|
|
|
960
941
|
var base64url = { pad: false, url: true };
|
|
961
942
|
async function authorizeUrl(auth, options) {
|
|
962
943
|
const { accessKey: accessKey2 } = options;
|
|
944
|
+
if (!accessKey2 && options.challenge !== void 0)
|
|
945
|
+
throw new ChallengeWithoutKeyError();
|
|
963
946
|
const redirectUri = options.redirectUri ?? auth.redirectUri ?? `${window.location.origin}/`;
|
|
964
947
|
const key = accessKey2 ? await resolve(accessKey2) : void 0;
|
|
965
948
|
const pending = from2({
|
|
966
949
|
...key ? key.material : { key: false },
|
|
967
950
|
chainId: auth.chainId,
|
|
968
|
-
...options.challenge !== void 0 ? { challenge: true } : {},
|
|
969
951
|
clientId: auth.clientId,
|
|
970
952
|
redirectUri,
|
|
971
953
|
// `Bytes.random` needs only `crypto.getRandomValues`, which React Native polyfills.
|
|
@@ -977,7 +959,6 @@ async function authorizeUrl(auth, options) {
|
|
|
977
959
|
}) : void 0;
|
|
978
960
|
const url = new URL("/oauth2/authorize", auth.url);
|
|
979
961
|
const parameters = new URLSearchParams({
|
|
980
|
-
...options.challenge !== void 0 && !accessKey2 ? { chain_id: String(auth.chainId) } : {},
|
|
981
962
|
...options.challenge === void 0 ? {} : { challenge: options.challenge },
|
|
982
963
|
client_id: auth.clientId,
|
|
983
964
|
// In the web message mode, Tempo ID sets the challenge and redeems the code itself.
|
|
@@ -1013,15 +994,9 @@ async function authorizeUrl(auth, options) {
|
|
|
1013
994
|
return { pending, url: url.href };
|
|
1014
995
|
}
|
|
1015
996
|
function request(auth, options) {
|
|
1016
|
-
const { accessKey: accessKey2, challenge
|
|
997
|
+
const { accessKey: accessKey2, challenge } = options;
|
|
1017
998
|
return {
|
|
1018
|
-
|
|
1019
|
-
// it, and any account that signs it in place of the selected one.
|
|
1020
|
-
...challenge2 !== void 0 && !accessKey2 ? {
|
|
1021
|
-
...options.account ? { account: options.account } : {},
|
|
1022
|
-
chain_id: auth.chainId
|
|
1023
|
-
} : {},
|
|
1024
|
-
...challenge2 === void 0 ? {} : { challenge: challenge2 },
|
|
999
|
+
...challenge === void 0 ? {} : { challenge },
|
|
1025
1000
|
client_id: auth.clientId,
|
|
1026
1001
|
...accessKey2 ? {
|
|
1027
1002
|
key_authorization: keyAuthorization(auth, {
|
|
@@ -1076,7 +1051,7 @@ function pushes(auth) {
|
|
|
1076
1051
|
|
|
1077
1052
|
// ../../accounts/src/internal/Headless.ts
|
|
1078
1053
|
async function authorize(auth, options) {
|
|
1079
|
-
const { accessKey: accessKey2, challenge
|
|
1054
|
+
const { accessKey: accessKey2, challenge, getFn } = options;
|
|
1080
1055
|
try {
|
|
1081
1056
|
const key = accessKey2 ? await resolve(accessKey2) : void 0;
|
|
1082
1057
|
if (key)
|
|
@@ -1090,11 +1065,11 @@ async function authorize(auth, options) {
|
|
|
1090
1065
|
getFn,
|
|
1091
1066
|
json: request(auth, {
|
|
1092
1067
|
accessKey: key && accessKey2 && { ...accessKey2, account: key.accessKey },
|
|
1093
|
-
challenge
|
|
1068
|
+
challenge
|
|
1094
1069
|
})
|
|
1095
1070
|
})
|
|
1096
1071
|
);
|
|
1097
|
-
const authorization2 = key ? authorization(body,
|
|
1072
|
+
const authorization2 = key ? authorization(body, key) : withoutKey(body);
|
|
1098
1073
|
if (authorization2.user.id !== options.userId) throw sessionChanged();
|
|
1099
1074
|
return {
|
|
1100
1075
|
...authorization2,
|
|
@@ -1116,12 +1091,7 @@ async function complete(auth, options) {
|
|
|
1116
1091
|
step: body.authorization
|
|
1117
1092
|
})
|
|
1118
1093
|
) : body.authorization;
|
|
1119
|
-
const authorization2 = key ? authorization(signed,
|
|
1120
|
-
...key,
|
|
1121
|
-
challenged: options.request.challenge !== void 0
|
|
1122
|
-
}) : withoutKey(signed, {
|
|
1123
|
-
challenged: options.request.challenge !== void 0
|
|
1124
|
-
});
|
|
1094
|
+
const authorization2 = key ? authorization(signed, key) : withoutKey(signed);
|
|
1125
1095
|
if (authorization2.user.id !== body.user.id) throw sessionChanged();
|
|
1126
1096
|
return {
|
|
1127
1097
|
...authorization2,
|
|
@@ -1200,7 +1170,7 @@ async function sign(auth, options) {
|
|
|
1200
1170
|
});
|
|
1201
1171
|
}
|
|
1202
1172
|
function steps(json2, options) {
|
|
1203
|
-
if (!json2.key_authorization
|
|
1173
|
+
if (!json2.key_authorization) return false;
|
|
1204
1174
|
return options.getFn !== void 0 || globalThis.navigator?.credentials !== void 0;
|
|
1205
1175
|
}
|
|
1206
1176
|
function redemption(auth) {
|
|
@@ -1245,14 +1215,14 @@ async function sendCode(auth, options) {
|
|
|
1245
1215
|
);
|
|
1246
1216
|
}
|
|
1247
1217
|
async function signIn(auth, options) {
|
|
1248
|
-
const { challenge
|
|
1218
|
+
const { challenge, code, email, userIp } = options;
|
|
1219
|
+
if (!options.accessKey && challenge !== void 0)
|
|
1220
|
+
throw new ChallengeWithoutKeyError();
|
|
1249
1221
|
authenticated(auth);
|
|
1250
1222
|
const { accessKey: accessKey2 } = options;
|
|
1251
1223
|
const key = accessKey2 ? await resolve(accessKey2) : void 0;
|
|
1252
1224
|
const body = await token(auth, {
|
|
1253
|
-
|
|
1254
|
-
...challenge2 !== void 0 && !key ? { chain_id: String(auth.chainId) } : {},
|
|
1255
|
-
...challenge2 === void 0 ? {} : { challenge: challenge2 },
|
|
1225
|
+
...challenge === void 0 ? {} : { challenge },
|
|
1256
1226
|
code,
|
|
1257
1227
|
email,
|
|
1258
1228
|
grant_type: grantType,
|
|
@@ -1271,19 +1241,14 @@ async function signIn(auth, options) {
|
|
|
1271
1241
|
});
|
|
1272
1242
|
const tokens3 = tokens(body);
|
|
1273
1243
|
if (!key)
|
|
1274
|
-
return {
|
|
1275
|
-
...tokens3,
|
|
1276
|
-
...challengeSignature(body, { challenged: challenge2 !== void 0 }),
|
|
1277
|
-
user: user(tokens3)
|
|
1278
|
-
};
|
|
1244
|
+
return { ...tokens3, user: user(tokens3) };
|
|
1279
1245
|
return authorization(
|
|
1280
1246
|
{
|
|
1281
1247
|
account: body.account,
|
|
1282
|
-
...body.challenge_signature ? { challenge_signature: body.challenge_signature } : {},
|
|
1283
1248
|
key_authorization: body.key_authorization,
|
|
1284
1249
|
tokens: tokens3
|
|
1285
1250
|
},
|
|
1286
|
-
|
|
1251
|
+
key
|
|
1287
1252
|
);
|
|
1288
1253
|
}
|
|
1289
1254
|
function authenticated(auth) {
|
|
@@ -1363,11 +1328,8 @@ __export(device_exports, {
|
|
|
1363
1328
|
});
|
|
1364
1329
|
import { Base64 as Base646 } from "ox";
|
|
1365
1330
|
async function authorize2(auth, options) {
|
|
1366
|
-
const
|
|
1367
|
-
const key = accessKey2 ? await resolve(accessKey2) : void 0;
|
|
1331
|
+
const key = await resolve(options.accessKey);
|
|
1368
1332
|
const body = new URLSearchParams({
|
|
1369
|
-
// A challenge without an access key names the instance's chain, whose view of the account signs it.
|
|
1370
|
-
...options.challenge !== void 0 && !key ? { chain_id: String(auth.chainId) } : {},
|
|
1371
1333
|
...options.challenge === void 0 ? {} : { challenge: options.challenge },
|
|
1372
1334
|
// The instance's app is the device app that the CLI signs in to, such as `tempo-cli`.
|
|
1373
1335
|
client_id: auth.clientId,
|
|
@@ -1375,16 +1337,14 @@ async function authorize2(auth, options) {
|
|
|
1375
1337
|
...options.funding?.currency === void 0 ? {} : { funding_currency: options.funding.currency },
|
|
1376
1338
|
...options.funding ? { funding_hint: options.funding.amount } : {},
|
|
1377
1339
|
...options.funding?.token === void 0 ? {} : { funding_token: options.funding.token },
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
)
|
|
1387
|
-
} : {}
|
|
1340
|
+
key_authorization: Base646.fromString(
|
|
1341
|
+
JSON.stringify(
|
|
1342
|
+
keyAuthorization(auth, {
|
|
1343
|
+
accessKey: { ...options.accessKey, account: key.accessKey }
|
|
1344
|
+
})
|
|
1345
|
+
),
|
|
1346
|
+
{ pad: false, url: true }
|
|
1347
|
+
)
|
|
1388
1348
|
});
|
|
1389
1349
|
for (const resource of resources(auth, options))
|
|
1390
1350
|
body.append("resource", resource);
|
|
@@ -1419,7 +1379,6 @@ async function authorize2(auth, options) {
|
|
|
1419
1379
|
);
|
|
1420
1380
|
failure = void 0;
|
|
1421
1381
|
const result = await request2(poll2, {
|
|
1422
|
-
challenged: options.challenge !== void 0,
|
|
1423
1382
|
deviceCode: code.device_code,
|
|
1424
1383
|
key
|
|
1425
1384
|
}).catch((error3) => {
|
|
@@ -1452,11 +1411,6 @@ async function authorize2(auth, options) {
|
|
|
1452
1411
|
}
|
|
1453
1412
|
async function poll(auth, options) {
|
|
1454
1413
|
const { deviceCode } = options;
|
|
1455
|
-
if (options.accessKey === false)
|
|
1456
|
-
return request2(auth, {
|
|
1457
|
-
deviceCode,
|
|
1458
|
-
key: void 0
|
|
1459
|
-
});
|
|
1460
1414
|
const accessKey2 = own(options.accessKey);
|
|
1461
1415
|
if (!accessKey2) throw new AccessKeyRequiredError();
|
|
1462
1416
|
return request2(auth, {
|
|
@@ -1483,20 +1437,15 @@ async function request2(auth, options) {
|
|
|
1483
1437
|
});
|
|
1484
1438
|
if (typeof body === "string")
|
|
1485
1439
|
return { slowDown: body === "slow_down", status: "pending" };
|
|
1486
|
-
const authorization2 = key ? authorization(
|
|
1487
|
-
{
|
|
1488
|
-
account: body.account,
|
|
1489
|
-
...body.challenge_signature ? { challenge_signature: body.challenge_signature } : {},
|
|
1490
|
-
key_authorization: body.key_authorization,
|
|
1491
|
-
tokens: tokens(body)
|
|
1492
|
-
},
|
|
1493
|
-
{ ...key, challenged: options.challenged }
|
|
1494
|
-
) : withoutKey(
|
|
1495
|
-
{ ...body, tokens: tokens(body) },
|
|
1496
|
-
{ challenged: options.challenged }
|
|
1497
|
-
);
|
|
1498
1440
|
return {
|
|
1499
|
-
authorization:
|
|
1441
|
+
authorization: authorization(
|
|
1442
|
+
{
|
|
1443
|
+
account: body.account,
|
|
1444
|
+
key_authorization: body.key_authorization,
|
|
1445
|
+
tokens: tokens(body)
|
|
1446
|
+
},
|
|
1447
|
+
key
|
|
1448
|
+
),
|
|
1500
1449
|
status: "approved"
|
|
1501
1450
|
};
|
|
1502
1451
|
}
|
|
@@ -1763,7 +1712,7 @@ async function open(auth, options) {
|
|
|
1763
1712
|
throw new OriginError({ origin: window.location.origin, redirectUri });
|
|
1764
1713
|
if (mode === "popup" && options.mode !== "popup" && !activated()) {
|
|
1765
1714
|
const address2 = await abortable(read2(), { signal });
|
|
1766
|
-
const Sheet = await import("./Sheet-
|
|
1715
|
+
const Sheet = await import("./Sheet-PTAFRAX2.js");
|
|
1767
1716
|
return await new Promise((resolve3, reject) => {
|
|
1768
1717
|
const abort = () => {
|
|
1769
1718
|
close();
|
|
@@ -1814,7 +1763,7 @@ async function watch(auth, options) {
|
|
|
1814
1763
|
try {
|
|
1815
1764
|
return await new Promise(
|
|
1816
1765
|
(resolve3, reject) => {
|
|
1817
|
-
void import("./Sheet-
|
|
1766
|
+
void import("./Sheet-PTAFRAX2.js").then(
|
|
1818
1767
|
(Sheet) => {
|
|
1819
1768
|
if (settled) return;
|
|
1820
1769
|
unblock = Sheet.waiting({
|
|
@@ -1879,7 +1828,7 @@ function parse(url, options) {
|
|
|
1879
1828
|
async function frame(auth, options) {
|
|
1880
1829
|
const { redirectUri, signal, toUrl } = options;
|
|
1881
1830
|
const address2 = await abortable(options.address, { signal });
|
|
1882
|
-
const Sheet = await import("./Sheet-
|
|
1831
|
+
const Sheet = await import("./Sheet-PTAFRAX2.js");
|
|
1883
1832
|
signal?.throwIfAborted();
|
|
1884
1833
|
let close;
|
|
1885
1834
|
let abort;
|
|
@@ -2137,7 +2086,6 @@ function finish(options) {
|
|
|
2137
2086
|
const {
|
|
2138
2087
|
key,
|
|
2139
2088
|
chainId: _chainId,
|
|
2140
|
-
challenge: challenged,
|
|
2141
2089
|
clientId: _clientId,
|
|
2142
2090
|
redirectUri: _redirectUri,
|
|
2143
2091
|
state: _state,
|
|
@@ -2146,11 +2094,7 @@ function finish(options) {
|
|
|
2146
2094
|
} = options.pending;
|
|
2147
2095
|
if (key === false) {
|
|
2148
2096
|
const tokens3 = tokens(body);
|
|
2149
|
-
return {
|
|
2150
|
-
...tokens3,
|
|
2151
|
-
...challengeSignature(body, { challenged }),
|
|
2152
|
-
user: user(tokens3)
|
|
2153
|
-
};
|
|
2097
|
+
return { ...tokens3, user: user(tokens3) };
|
|
2154
2098
|
}
|
|
2155
2099
|
if (!body.account || !body.key_authorization)
|
|
2156
2100
|
throw new RequestError({
|
|
@@ -2162,11 +2106,10 @@ function finish(options) {
|
|
|
2162
2106
|
return authorization(
|
|
2163
2107
|
{
|
|
2164
2108
|
account: body.account,
|
|
2165
|
-
...body.challenge_signature ? { challenge_signature: body.challenge_signature } : {},
|
|
2166
2109
|
key_authorization: body.key_authorization,
|
|
2167
2110
|
tokens: body
|
|
2168
2111
|
},
|
|
2169
|
-
{ accessKey: options.accessKey,
|
|
2112
|
+
{ accessKey: options.accessKey, material }
|
|
2170
2113
|
);
|
|
2171
2114
|
}
|
|
2172
2115
|
async function prefetch(auth) {
|
|
@@ -2703,10 +2646,6 @@ function toSession(result) {
|
|
|
2703
2646
|
return from4({
|
|
2704
2647
|
accessToken: result.accessToken,
|
|
2705
2648
|
...result.account ? { account: result.account } : {},
|
|
2706
|
-
...result.address && result.challengeSignature ? {
|
|
2707
|
-
address: result.address,
|
|
2708
|
-
challengeSignature: result.challengeSignature
|
|
2709
|
-
} : {},
|
|
2710
2649
|
expiresAt: result.expiresAt,
|
|
2711
2650
|
...result.idToken !== void 0 ? { idToken: result.idToken } : {},
|
|
2712
2651
|
...result.key ? { key: withLifetime(result.key) } : {},
|
|
@@ -2752,6 +2691,8 @@ async function sendCode2(auth, options) {
|
|
|
2752
2691
|
}
|
|
2753
2692
|
async function signIn3(auth, options) {
|
|
2754
2693
|
const { code, email, getFn, link } = options;
|
|
2694
|
+
if (!options.accessKey && options.challenge !== void 0)
|
|
2695
|
+
throw new ChallengeWithoutKeyError();
|
|
2755
2696
|
const prepared = await prepare(auth, options);
|
|
2756
2697
|
const assertion = await (async () => {
|
|
2757
2698
|
if (!link) return void 0;
|
|
@@ -2953,13 +2894,6 @@ function prepare2(auth, options = {}) {
|
|
|
2953
2894
|
}
|
|
2954
2895
|
async function register(auth, options = {}) {
|
|
2955
2896
|
const { createFn, getFn, key } = options;
|
|
2956
|
-
if (options.challenge !== void 0 && !options.accessKey)
|
|
2957
|
-
throw new RequestError({
|
|
2958
|
-
code: "invalid_request",
|
|
2959
|
-
field: "challenge",
|
|
2960
|
-
message: "Invalid options: `challenge` signs as the new passkey's account, which only a registration with `accessKey` selects. Pass `accessKey`, or sign in with the challenge.",
|
|
2961
|
-
status: 0
|
|
2962
|
-
});
|
|
2963
2897
|
const chain = options.chain ?? options.chainId;
|
|
2964
2898
|
if (options.accessKey && (key || options.account !== void 0 || chain !== void 0))
|
|
2965
2899
|
throw new RequestError({
|
|
@@ -3051,60 +2985,14 @@ async function register(auth, options = {}) {
|
|
|
3051
2985
|
signed,
|
|
3052
2986
|
headless.key
|
|
3053
2987
|
);
|
|
3054
|
-
const challenged = options.challenge === void 0 ? {} : await challenge(
|
|
3055
|
-
{ ...auth, chainId: Number(authorization2.key.chainId) },
|
|
3056
|
-
{
|
|
3057
|
-
account: registered.address,
|
|
3058
|
-
challenge: options.challenge,
|
|
3059
|
-
getFn,
|
|
3060
|
-
userId: authorization2.user.id
|
|
3061
|
-
}
|
|
3062
|
-
);
|
|
3063
2988
|
return {
|
|
3064
2989
|
...result,
|
|
3065
2990
|
authorization: {
|
|
3066
2991
|
...authorization2,
|
|
3067
|
-
..."challengeError" in challenged ? {} : challenged,
|
|
3068
2992
|
upgradeAvailable: signed.upgrade_available === true
|
|
3069
|
-
}
|
|
3070
|
-
..."challengeError" in challenged ? { challengeError: challenged.challengeError } : {}
|
|
2993
|
+
}
|
|
3071
2994
|
};
|
|
3072
2995
|
}
|
|
3073
|
-
async function challenge(auth, options) {
|
|
3074
|
-
try {
|
|
3075
|
-
const body = await json(
|
|
3076
|
-
await post2(auth, {
|
|
3077
|
-
getFn: options.getFn,
|
|
3078
|
-
json: request(auth, {
|
|
3079
|
-
account: options.account,
|
|
3080
|
-
challenge: options.challenge
|
|
3081
|
-
})
|
|
3082
|
-
})
|
|
3083
|
-
);
|
|
3084
|
-
const tokens3 = "accessToken" in body.tokens ? body.tokens : tokens(body.tokens);
|
|
3085
|
-
if (tokens3.refreshToken)
|
|
3086
|
-
await revoke(auth, { refreshToken: tokens3.refreshToken }).catch(
|
|
3087
|
-
() => void 0
|
|
3088
|
-
);
|
|
3089
|
-
const signed = challengeSignature(body, { challenged: true });
|
|
3090
|
-
if (user(tokens3).id !== options.userId || !Address3.isEqual(signed.address, options.account))
|
|
3091
|
-
throw new RequestError({
|
|
3092
|
-
code: "server_error",
|
|
3093
|
-
message: "Account mismatch: Tempo ID signed the challenge as another account or user than the new passkey's. The passkey is registered, so sign in with it and the challenge.",
|
|
3094
|
-
status: 200
|
|
3095
|
-
});
|
|
3096
|
-
return signed;
|
|
3097
|
-
} catch (error3) {
|
|
3098
|
-
return {
|
|
3099
|
-
challengeError: error3 instanceof RequestError ? error3 : new RequestError({
|
|
3100
|
-
cause: error3,
|
|
3101
|
-
code: "server_error",
|
|
3102
|
-
message: "Challenge signature failed after the registration, with no response from Tempo ID. The passkey is registered, so sign in with it and the challenge.",
|
|
3103
|
-
status: 0
|
|
3104
|
-
})
|
|
3105
|
-
};
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
2996
|
async function signIn4(auth, options = {}) {
|
|
3109
2997
|
const prepared = await requestOptions(auth, options);
|
|
3110
2998
|
const assertion = await sign2(prepared, options);
|
|
@@ -3129,6 +3017,8 @@ function refused(error3) {
|
|
|
3129
3017
|
}
|
|
3130
3018
|
async function requestOptions(auth, options) {
|
|
3131
3019
|
const { credentialId, mediation, select } = options;
|
|
3020
|
+
if (!options.accessKey && options.challenge !== void 0)
|
|
3021
|
+
throw new ChallengeWithoutKeyError();
|
|
3132
3022
|
const { authorize: authorize6, key } = await prepare(auth, options);
|
|
3133
3023
|
const requestedAt = Date.now();
|
|
3134
3024
|
const requested = await json(
|
|
@@ -3213,6 +3103,8 @@ async function list(auth) {
|
|
|
3213
3103
|
// ../../accounts/src/internal/Actions.ts
|
|
3214
3104
|
async function authorize4(auth, options = {}) {
|
|
3215
3105
|
const { accessKey: accessKey2 } = options;
|
|
3106
|
+
if (!accessKey2 && options.challenge !== void 0)
|
|
3107
|
+
throw new ChallengeWithoutKeyError();
|
|
3216
3108
|
const [session2, generated] = await Promise.all([
|
|
3217
3109
|
(async () => json(
|
|
3218
3110
|
await (auth.fetch ?? globalThis.fetch)(
|
|
@@ -3246,10 +3138,7 @@ async function authorize4(auth, options = {}) {
|
|
|
3246
3138
|
const body = await json(response);
|
|
3247
3139
|
const [first] = body.tempo ?? [];
|
|
3248
3140
|
const result = {
|
|
3249
|
-
...key ? authorization(body,
|
|
3250
|
-
...key,
|
|
3251
|
-
challenged: options.challenge !== void 0
|
|
3252
|
-
}) : withoutKey(body, { challenged: options.challenge !== void 0 }),
|
|
3141
|
+
...key ? authorization(body, key) : withoutKey(body),
|
|
3253
3142
|
// The response lists the access key's account first, so the app reads no `GET /v1/account`.
|
|
3254
3143
|
// An account that the client cannot rebuild stays absent, so the session holds the access key alone.
|
|
3255
3144
|
...key && first ? (() => {
|
|
@@ -3522,7 +3411,7 @@ var signInIds = /* @__PURE__ */ new Set([
|
|
|
3522
3411
|
function plugin() {
|
|
3523
3412
|
let loading;
|
|
3524
3413
|
function load() {
|
|
3525
|
-
loading ??= import("./dialog-
|
|
3414
|
+
loading ??= import("./dialog-7DSDKEHU.js").then((module) => module.dialog()).catch((error3) => {
|
|
3526
3415
|
loading = void 0;
|
|
3527
3416
|
throw error3;
|
|
3528
3417
|
});
|
|
@@ -4477,6 +4366,14 @@ var ChainUnavailableError = class extends Error {
|
|
|
4477
4366
|
);
|
|
4478
4367
|
}
|
|
4479
4368
|
};
|
|
4369
|
+
var ChallengeWithoutKeyError = class extends Error {
|
|
4370
|
+
name = "Accounts.ChallengeWithoutKeyError";
|
|
4371
|
+
constructor() {
|
|
4372
|
+
super(
|
|
4373
|
+
"A challenge rides in the key authorization, so a sign-in without `accessKey` takes none. Remove `challenge`, or pass `accessKey` to request an access key."
|
|
4374
|
+
);
|
|
4375
|
+
}
|
|
4376
|
+
};
|
|
4480
4377
|
var ClientIdRequiredError = class extends Error {
|
|
4481
4378
|
name = "Accounts.ClientIdRequiredError";
|
|
4482
4379
|
constructor() {
|
|
@@ -4734,7 +4631,7 @@ function create4(options = {}) {
|
|
|
4734
4631
|
function connections2() {
|
|
4735
4632
|
if (!connectionsOptions)
|
|
4736
4633
|
return Promise.reject(new ConnectionsRequiredError());
|
|
4737
|
-
attached ??= import("./Connections-
|
|
4634
|
+
attached ??= import("./Connections-7J5I4L3Q.js").then(
|
|
4738
4635
|
(module) => module.attach(config, connectionsOptions)
|
|
4739
4636
|
);
|
|
4740
4637
|
return attached;
|
package/dist/commands/login.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env,
|
|
3
3
|
login
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-FDHRRJQI.js";
|
|
5
|
+
import "../chunk-JJT3ITRO.js";
|
|
6
|
+
import "../chunk-YDYAVOWG.js";
|
|
7
7
|
import "../chunk-YW5DUQT3.js";
|
|
8
8
|
import "../chunk-MLKGABMK.js";
|
|
9
9
|
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env,
|
|
3
3
|
remove
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-FDHRRJQI.js";
|
|
5
|
+
import "../chunk-JJT3ITRO.js";
|
|
6
|
+
import "../chunk-YDYAVOWG.js";
|
|
7
7
|
import "../chunk-YW5DUQT3.js";
|
|
8
8
|
import "../chunk-MLKGABMK.js";
|
|
9
9
|
|
package/dist/commands/whoami.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
env,
|
|
3
3
|
signedOut,
|
|
4
4
|
whoami
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-FDHRRJQI.js";
|
|
6
|
+
import "../chunk-JJT3ITRO.js";
|
|
7
|
+
import "../chunk-YDYAVOWG.js";
|
|
8
8
|
import "../chunk-YW5DUQT3.js";
|
|
9
9
|
import "../chunk-MLKGABMK.js";
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=24.21"
|
|
10
10
|
},
|
|
11
11
|
"name": "@tempoxyz/id",
|
|
12
|
-
"version": "0.0.0-pr-
|
|
12
|
+
"version": "0.0.0-pr-708.sha-bb6f1e1",
|
|
13
13
|
"description": "The tempo-id CLI: sign in to Tempo ID, and call its API and the Admin API.",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"bin": {
|