@tempoxyz/id 0.0.0-pr-479.sha-3ea98d2 → 0.0.0-pr-481.sha-e1aaa69
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 +0 -2
- package/dist/Actions.d.ts +13 -13
- package/dist/Actions.js +9 -9
- package/dist/Actions.js.map +1 -1
- package/dist/Authorization.d.ts +1 -1
- package/dist/Authorization.d.ts.map +1 -1
- package/dist/Id.d.ts +10 -10
- package/dist/Id.d.ts.map +1 -1
- package/dist/Id.js +3 -3
- package/dist/Id.js.map +1 -1
- package/dist/Key.d.ts +8 -8
- package/dist/Key.d.ts.map +1 -1
- package/dist/Key.js +5 -5
- package/dist/Key.js.map +1 -1
- package/dist/Pending.d.ts +2 -2
- package/dist/Pending.d.ts.map +1 -1
- package/dist/Permissions.d.ts +7 -7
- package/dist/Permissions.d.ts.map +1 -1
- package/dist/Plugin.d.ts +1 -1
- package/dist/Plugin.d.ts.map +1 -1
- package/dist/Session.d.ts +1 -1
- package/dist/Session.js +1 -1
- package/dist/actions/account.d.ts +14 -14
- package/dist/actions/account.d.ts.map +1 -1
- package/dist/actions/account.js +6 -6
- package/dist/actions/account.js.map +1 -1
- package/dist/actions/backend/email.d.ts +4 -4
- package/dist/actions/backend/email.js +4 -4
- package/dist/actions/backend/email.js.map +1 -1
- package/dist/actions/device.d.ts +3 -3
- package/dist/actions/device.js +2 -2
- package/dist/actions/device.js.map +1 -1
- package/dist/actions/dialog.d.ts +5 -5
- package/dist/actions/dialog.d.ts.map +1 -1
- package/dist/actions/dialog.js +3 -3
- package/dist/actions/email.d.ts +12 -12
- package/dist/actions/email.d.ts.map +1 -1
- package/dist/actions/email.js +10 -10
- package/dist/actions/email.js.map +1 -1
- package/dist/actions/passkey.d.ts +18 -18
- package/dist/actions/passkey.d.ts.map +1 -1
- package/dist/actions/passkey.js +13 -13
- package/dist/actions/passkey.js.map +1 -1
- package/dist/actions/redirect.d.ts +10 -10
- package/dist/actions/redirect.d.ts.map +1 -1
- package/dist/actions/redirect.js +5 -5
- package/dist/actions/redirect.js.map +1 -1
- package/dist/internal/accessKey.d.ts +6 -6
- package/dist/internal/accessKey.d.ts.map +1 -1
- package/dist/internal/accessKey.js +4 -4
- package/dist/internal/api.d.ts +7 -7
- package/dist/internal/api.d.ts.map +1 -1
- package/dist/internal/api.js +5 -5
- package/dist/internal/api.js.map +1 -1
- package/dist/internal/backendSessions.d.ts +1 -1
- package/dist/internal/backendSessions.js +2 -2
- package/dist/internal/backendSessions.js.map +1 -1
- package/dist/internal/core.d.ts +4 -4
- package/dist/internal/core.d.ts.map +1 -1
- package/dist/internal/core.js +5 -5
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/headless.d.ts +15 -15
- package/dist/internal/headless.d.ts.map +1 -1
- package/dist/internal/headless.js +7 -7
- package/dist/internal/headless.js.map +1 -1
- package/dist/internal/request.d.ts +8 -8
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js +4 -4
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/session.d.ts +1 -1
- package/dist/internal/session.js +2 -2
- package/dist/internal/session.js.map +1 -1
- package/dist/internal/signIn.d.ts +4 -4
- package/dist/internal/signIn.d.ts.map +1 -1
- package/dist/internal/signIn.js +2 -2
- package/dist/internal/signIn.js.map +1 -1
- package/dist/internal/signer.d.ts +1 -1
- package/dist/internal/signer.js +2 -2
- package/dist/internal/signer.js.map +1 -1
- package/dist/internal/verifier.d.ts +2 -2
- package/dist/internal/verifier.d.ts.map +1 -1
- package/dist/internal/viem/accessKey.d.ts +5 -5
- package/dist/internal/viem/accessKey.d.ts.map +1 -1
- package/dist/internal/viem/accessKey.js +7 -7
- package/dist/internal/viem/accessKey.js.map +1 -1
- package/dist/plugins/backend.d.ts +1 -1
- package/dist/plugins/device.d.ts +3 -3
- package/dist/plugins/device.js +1 -1
- package/dist/plugins/dialog.d.ts +1 -1
- package/dist/plugins/email.d.ts +4 -4
- package/dist/plugins/email.js +1 -1
- package/dist/plugins/passkey.d.ts +3 -3
- package/dist/plugins/passkey.js +1 -1
- package/dist/plugins/passkey.js.map +1 -1
- package/dist/plugins/redirect.d.ts +1 -1
- package/dist/plugins/viem.d.ts +1 -1
- package/dist/plugins/viem.js +1 -1
- package/dist/plugins/viem.js.map +1 -1
- package/dist/wagmi.d.ts +3 -3
- package/dist/wagmi.js +6 -6
- package/dist/wagmi.js.map +1 -1
- package/package.json +2 -2
- package/src/Actions.ts +16 -16
- package/src/Authorization.ts +1 -1
- package/src/Id.ts +10 -10
- package/src/Key.ts +9 -9
- package/src/Pending.ts +2 -2
- package/src/Permissions.ts +7 -7
- package/src/Plugin.ts +1 -1
- package/src/Session.ts +1 -1
- package/src/actions/account.ts +15 -15
- package/src/actions/backend/email.ts +6 -6
- package/src/actions/device.ts +4 -4
- package/src/actions/dialog.ts +5 -5
- package/src/actions/email.ts +16 -16
- package/src/actions/passkey.ts +24 -24
- package/src/actions/redirect.ts +14 -14
- package/src/internal/accessKey.ts +6 -6
- package/src/internal/api.ts +9 -9
- package/src/internal/backendSessions.ts +4 -4
- package/src/internal/core.ts +7 -7
- package/src/internal/headless.ts +18 -18
- package/src/internal/request.ts +11 -11
- package/src/internal/session.ts +3 -3
- package/src/internal/signIn.ts +4 -4
- package/src/internal/signer.ts +2 -2
- package/src/internal/verifier.ts +2 -2
- package/src/internal/viem/accessKey.ts +8 -8
- package/src/plugins/backend.ts +1 -1
- package/src/plugins/device.ts +3 -3
- package/src/plugins/dialog.ts +1 -1
- package/src/plugins/email.ts +4 -4
- package/src/plugins/passkey.ts +4 -4
- package/src/plugins/redirect.ts +1 -1
- package/src/plugins/viem.ts +2 -2
- package/src/wagmi.ts +7 -7
|
@@ -52,9 +52,9 @@ export declare namespace get {
|
|
|
52
52
|
* Revokes the access key `accessKey` of the user's Tempo Account `account` on the chain `chainId`,
|
|
53
53
|
* with the user's cloud wallet as the owner. Tempo ID sends the transaction from the account, since
|
|
54
54
|
* the chain refuses keychain changes from an access key, and returns its receipt, or `null` when the
|
|
55
|
-
* chain held the key revoked already.
|
|
55
|
+
* chain held the access key revoked already. An access key that the chain has not registered yet registers without
|
|
56
56
|
* limits or calls and revokes in the same transaction, so its key authorization can never register
|
|
57
|
-
* it later. The key must be one that Tempo ID signed for the user. Call it from the page of a
|
|
57
|
+
* it later. The access key must be one that Tempo ID signed for the user. Call it from the page of a
|
|
58
58
|
* first-party app with the `tempo-id:sign` scope, after the user approves the revocation there.
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
@@ -71,14 +71,14 @@ export declare namespace revokeKey {
|
|
|
71
71
|
type Options = {
|
|
72
72
|
/** The access key's address. */
|
|
73
73
|
accessKey: `0x${string}`;
|
|
74
|
-
/** The address of the user's Tempo Account that the key acts for. */
|
|
74
|
+
/** The address of the user's Tempo Account that the access key acts for. */
|
|
75
75
|
account: `0x${string}`;
|
|
76
|
-
/** The key's chain ID. */
|
|
76
|
+
/** The access key's chain ID. */
|
|
77
77
|
chainId: number;
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
80
|
* The receipt of the revoking transaction, which Tempo ID returns with its response, or `null`
|
|
81
|
-
* when the chain held the key revoked already.
|
|
81
|
+
* when the chain held the access key revoked already.
|
|
82
82
|
*/
|
|
83
83
|
type ReturnType = TransactionReceipt | null;
|
|
84
84
|
}
|
|
@@ -153,8 +153,8 @@ export declare namespace signTypedData {
|
|
|
153
153
|
/**
|
|
154
154
|
* Sets the remaining limits of the access key `accessKey`, which the chain registered for the user's
|
|
155
155
|
* Tempo Account `account` on the chain `chainId`, with the user's cloud wallet as the owner. Each
|
|
156
|
-
* limit replaces the amount of its token that the key can still spend, and keeps the limit's period.
|
|
157
|
-
* Tempo ID sends the transaction from the account, and returns its receipt.
|
|
156
|
+
* limit replaces the amount of its token that the access key can still spend, and keeps the limit's period.
|
|
157
|
+
* Tempo ID sends the transaction from the account, and returns its receipt. An access key that the chain has not
|
|
158
158
|
* registered yet takes new limits through a new key authorization instead, such as
|
|
159
159
|
* `Actions.authorize`. The request needs a sign-in within the last 10 minutes. Call it from the page
|
|
160
160
|
* of a first-party app with the `tempo-id:sign` scope, after the user approves the limits there.
|
|
@@ -174,13 +174,13 @@ export declare namespace updateKeyLimits {
|
|
|
174
174
|
type Options = {
|
|
175
175
|
/** The access key's address. */
|
|
176
176
|
accessKey: `0x${string}`;
|
|
177
|
-
/** The address of the user's Tempo Account that the key acts for. */
|
|
177
|
+
/** The address of the user's Tempo Account that the access key acts for. */
|
|
178
178
|
account: `0x${string}`;
|
|
179
|
-
/** The key's chain ID. */
|
|
179
|
+
/** The access key's chain ID. */
|
|
180
180
|
chainId: number;
|
|
181
181
|
/** The new remaining limits, one for each token. A token that the list leaves out keeps its limit. */
|
|
182
182
|
limits: readonly {
|
|
183
|
-
/** The amount of the token that the key can still spend, in base units. */
|
|
183
|
+
/** The amount of the token that the access key can still spend, in base units. */
|
|
184
184
|
limit: bigint;
|
|
185
185
|
/** The TIP-20 token. */
|
|
186
186
|
token: `0x${string}`;
|
|
@@ -190,7 +190,7 @@ export declare namespace updateKeyLimits {
|
|
|
190
190
|
/**
|
|
191
191
|
* Upgrades a wallet.tempo passkey's account in place to a configurable account (TIP-1113), on the
|
|
192
192
|
* chain of `key`, from a page that the passkey's relying party covers. The passkey signs once. With
|
|
193
|
-
* `key`,
|
|
193
|
+
* `key`, an access key that signed as the passkey's own account, Tempo ID first registers the access key through a
|
|
194
194
|
* transaction that its access key signs and Tempo ID sponsors, so the key keeps working after the
|
|
195
195
|
* upgrade. The account keeps its address. The passkey stays its only owner, unless `addOwner`
|
|
196
196
|
* adds the user's Privy wallet in the same transaction. Call it when a sign-in or
|
|
@@ -216,7 +216,7 @@ export declare namespace upgrade {
|
|
|
216
216
|
account?: `0x${string}` | undefined;
|
|
217
217
|
/**
|
|
218
218
|
* The owner that the upgrade adds beside the passkey. `privy` adds the user's Privy wallet, so an
|
|
219
|
-
* emailed-code sign-in reaches the account and signs its keys. For an upgraded account that the
|
|
219
|
+
* emailed-code sign-in reaches the account and signs its access keys. For an upgraded account that the
|
|
220
220
|
* passkey alone owns, the passkey signs the update that adds it. Absent, the passkey stays the
|
|
221
221
|
* only owner.
|
|
222
222
|
*/
|
|
@@ -232,8 +232,8 @@ export declare namespace upgrade {
|
|
|
232
232
|
/** Runs the WebAuthn ceremony in place of `navigator.credentials.get`. */
|
|
233
233
|
getFn?: Authentication.sign.Options['getFn'] | undefined;
|
|
234
234
|
/**
|
|
235
|
-
* The key of an authorization with `upgradeAvailable: true`, which the chain registers before
|
|
236
|
-
* the upgrade. Without it,
|
|
235
|
+
* The access key of an authorization with `upgradeAvailable: true`, which the chain registers before
|
|
236
|
+
* the upgrade. Without it, an access key that the passkey signed as its own account stops working.
|
|
237
237
|
*/
|
|
238
238
|
key?: Key.Key | undefined;
|
|
239
239
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/actions/account.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAc,MAAM,aAAa,CAAA;AACxD,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,GAAG,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,GAAG,CAAC,OAAY,GACxB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAmDzB;AAED,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC;IAC3B,KAAK,OAAO,GAAG;QACb;;;;;;;WAOG;QACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,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E,MAAM,CAAA;QACf,sGAAsG;QACtG,MAAM,EAAE,SAAS;YACf,kFAAkF;YAClF,KAAK,EAAE,MAAM,CAAA;YACb,wBAAwB;YACxB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAA;SACrB,EAAE,CAAA;KACJ,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,CAAC,OAAO,GACvB,OAAO,CAAC,YAAY,CAAC,CAmDvB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,OAAO,GAAG;QACb,sFAAsF;QACtF,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC9C,yDAAyD;QACzD,OAAO,CAAC,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,CAAA;QACnC;;;;;WAKG;QACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QAC9B;;;;WAIG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;QACnC,+DAA+D;QAC/D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC5B,0EAA0E;QAC1E,KAAK,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;QACxD;;;WAGG;QACH,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,SAAS,CAAA;KAC1B,CAAA;CACF"}
|
package/dist/actions/account.js
CHANGED
|
@@ -70,9 +70,9 @@ export async function get(auth, options = {}) {
|
|
|
70
70
|
* Revokes the access key `accessKey` of the user's Tempo Account `account` on the chain `chainId`,
|
|
71
71
|
* with the user's cloud wallet as the owner. Tempo ID sends the transaction from the account, since
|
|
72
72
|
* the chain refuses keychain changes from an access key, and returns its receipt, or `null` when the
|
|
73
|
-
* chain held the key revoked already.
|
|
73
|
+
* chain held the access key revoked already. An access key that the chain has not registered yet registers without
|
|
74
74
|
* limits or calls and revokes in the same transaction, so its key authorization can never register
|
|
75
|
-
* it later. The key must be one that Tempo ID signed for the user. Call it from the page of a
|
|
75
|
+
* it later. The access key must be one that Tempo ID signed for the user. Call it from the page of a
|
|
76
76
|
* first-party app with the `tempo-id:sign` scope, after the user approves the revocation there.
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
@@ -169,8 +169,8 @@ export async function signTypedData(auth, options) {
|
|
|
169
169
|
/**
|
|
170
170
|
* Sets the remaining limits of the access key `accessKey`, which the chain registered for the user's
|
|
171
171
|
* Tempo Account `account` on the chain `chainId`, with the user's cloud wallet as the owner. Each
|
|
172
|
-
* limit replaces the amount of its token that the key can still spend, and keeps the limit's period.
|
|
173
|
-
* Tempo ID sends the transaction from the account, and returns its receipt.
|
|
172
|
+
* limit replaces the amount of its token that the access key can still spend, and keeps the limit's period.
|
|
173
|
+
* Tempo ID sends the transaction from the account, and returns its receipt. An access key that the chain has not
|
|
174
174
|
* registered yet takes new limits through a new key authorization instead, such as
|
|
175
175
|
* `Actions.authorize`. The request needs a sign-in within the last 10 minutes. Call it from the page
|
|
176
176
|
* of a first-party app with the `tempo-id:sign` scope, after the user approves the limits there.
|
|
@@ -204,7 +204,7 @@ export async function updateKeyLimits(auth, options) {
|
|
|
204
204
|
/**
|
|
205
205
|
* Upgrades a wallet.tempo passkey's account in place to a configurable account (TIP-1113), on the
|
|
206
206
|
* chain of `key`, from a page that the passkey's relying party covers. The passkey signs once. With
|
|
207
|
-
* `key`,
|
|
207
|
+
* `key`, an access key that signed as the passkey's own account, Tempo ID first registers the access key through a
|
|
208
208
|
* transaction that its access key signs and Tempo ID sponsors, so the key keeps working after the
|
|
209
209
|
* upgrade. The account keeps its address. The passkey stays its only owner, unless `addOwner`
|
|
210
210
|
* adds the user's Privy wallet in the same transaction. Call it when a sign-in or
|
|
@@ -224,7 +224,7 @@ export async function updateKeyLimits(auth, options) {
|
|
|
224
224
|
export async function upgrade(auth, options) {
|
|
225
225
|
const { getFn, key } = options;
|
|
226
226
|
const account = options.account ?? key?.account;
|
|
227
|
-
//
|
|
227
|
+
// An access key without material and without `accessKey` throws here, before any request.
|
|
228
228
|
const signer = key
|
|
229
229
|
? Key.toAccount(key, { accessKey: options.accessKey })
|
|
230
230
|
: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/actions/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,cAAc,EAAc,MAAM,aAAa,CAAA;AACxD,OAAO,EACL,wBAAwB,GAKzB,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAGhC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,IAAY,EACZ,OAAO,GAAgB,EAAE;IAEzB,2DAA2D;IAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,OAAO,CAAA;IAC9C,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,eAAe,IAAI,eAAe,CAAC;QACjC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,SAAS,EAAE,IAAI,CAAC,QAAQ;KACzB,CAAC,EAAE,EACJ,IAAI,CAAC,GAAG,CACT,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,CAI3B,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,GAAG,EAAE;QAC/B,WAAW,EAAE,SAAS;QACtB,GAAG,CAAC,OAAO,CAAC,WAAW;Y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AG,YAAY,EAAE,KAAK,EAAY,CAAC,CAAC,CAAC,YAAY,CAC7D,CACF,CAAA;IACD,+FAA+F;IAC/F,MAAM,SAAS,GACb,IAAI,CAAC,GAAG,IAAI,MAAM;QAChB,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;QACzD,CAAC,CAAC,SAAS,CAAA;IACf,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAC7B,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,EAAE;QAC1C,IAAI,EAAE;YACJ,GAAG,IAAI;YACP,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5C,OAAO,EAAE,EAAE,SAAS,EAAE;SACvB;KACF,CAAC,CACH,CAAA;IACD,OAAO,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -29,8 +29,8 @@ export declare namespace sendCode {
|
|
|
29
29
|
/**
|
|
30
30
|
* Signs the user in with the emailed code, from the app's backend, and returns the user's tokens.
|
|
31
31
|
* The first sign-in of an address creates the user, and each sign-in creates the user's first
|
|
32
|
-
* Tempo Account if the user holds none. The key must fit the headless ceiling. A passkey-owned
|
|
33
|
-
* account throws `webauthn_required`, since no page signs its key.
|
|
32
|
+
* Tempo Account if the user holds none. The access key must fit the headless ceiling. A passkey-owned
|
|
33
|
+
* account throws `webauthn_required`, since no page signs its access key.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```ts
|
|
@@ -41,13 +41,13 @@ export declare function signIn<const permissions extends Permissions | undefined
|
|
|
41
41
|
export declare namespace signIn {
|
|
42
42
|
type Options<permissions extends Permissions | undefined = Permissions | undefined> = {
|
|
43
43
|
/**
|
|
44
|
-
* The key to authorize. Defaults to a new secp256k1 key. Its `access` names the Tempo Account,
|
|
44
|
+
* The access key to authorize. Defaults to a new secp256k1 access key. Its `access` names the Tempo Account,
|
|
45
45
|
* which defaults to the app's selected account, or the user's oldest.
|
|
46
46
|
*/
|
|
47
47
|
accessKey?: Account.Account | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
|
|
50
|
-
* `tempo-id:sign` scope and
|
|
50
|
+
* `tempo-id:sign` scope and an access key.
|
|
51
51
|
*/
|
|
52
52
|
challenge?: ([permissions] extends [undefined] ? never : string) | undefined;
|
|
53
53
|
/** The 6-digit code that Tempo ID emailed. */
|
|
@@ -38,8 +38,8 @@ export async function sendCode(auth, options) {
|
|
|
38
38
|
/**
|
|
39
39
|
* Signs the user in with the emailed code, from the app's backend, and returns the user's tokens.
|
|
40
40
|
* The first sign-in of an address creates the user, and each sign-in creates the user's first
|
|
41
|
-
* Tempo Account if the user holds none. The key must fit the headless ceiling. A passkey-owned
|
|
42
|
-
* account throws `webauthn_required`, since no page signs its key.
|
|
41
|
+
* Tempo Account if the user holds none. The access key must fit the headless ceiling. A passkey-owned
|
|
42
|
+
* account throws `webauthn_required`, since no page signs its access key.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```ts
|
|
@@ -48,11 +48,11 @@ export async function sendCode(auth, options) {
|
|
|
48
48
|
*/
|
|
49
49
|
export async function signIn(auth, options) {
|
|
50
50
|
const { challenge, code, email, userIp } = options;
|
|
51
|
-
// A challenge rides in the key, so a sign-in without one refuses it before it signs in.
|
|
51
|
+
// A challenge rides in the access key, so a sign-in without one refuses it before it signs in.
|
|
52
52
|
if (!options.permissions && challenge !== undefined)
|
|
53
53
|
throw new ChallengeWithoutKeyError();
|
|
54
54
|
authenticated(auth);
|
|
55
|
-
// Permissions request the key.
|
|
55
|
+
// Permissions request the access key.
|
|
56
56
|
const { permissions } = options;
|
|
57
57
|
const key = permissions
|
|
58
58
|
? await AccessKey.resolve(options.accessKey)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/actions/backend/email.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAA;AAE3B,OAAO,EAEL,wBAAwB,EACxB,YAAY,GACb,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAA;AACxD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAK5D,8DAA8D;AAC9D,MAAM,SAAS,GAAG,8CAA8C,CAAA;AAEhE;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAY,EACZ,OAAyB;IAEzB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IACjC,MAAM,GAAG,CAAC,IAAI,CACZ,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE;QAC9D,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,GAAG,CAAC,MAAM,GAAG,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;YACxD,KAAK;YACL,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvC,CAAC;QACF,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,MAAM,EAAE,MAAM;KACf,CAAC,CACH,CAAA;AACH,CAAC;AAcD;;;;;;;;;;GAUG;AACH,MAAM,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,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC/B,mEAAmE;IACnE,IAAI,CAAC,GAAG;QACN,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAGzC,CAAA;IACH,OAAO,GAAG,CAAC,aAAa,CACtB;QACE,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,MAAM;KACP,EACD,GAAG,CAC2D,CAAA;AAClE,CAAC;AAoCD,wFAAwF;AACxF,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAA;IAC1D,MAAM,IAAI,YAAY,CAAC;QACrB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EACL,8LAA8L;QAChM,MAAM,EAAE,gBAAgB;QACxB,MAAM,EAAE,CAAC;KACV,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/actions/device.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { Permissions } from '../Permissions.js';
|
|
|
8
8
|
* resolves with the authorization. The instance's `clientId` names the device app, such as
|
|
9
9
|
* `tempo-cli`, whose realms the sign-in uses. A CLI without a registration sends `cli:` and its
|
|
10
10
|
* name, such as `cli:acme-deploy`. The device page then shows its name as unverified, and its
|
|
11
|
-
* `permissions` must name the key's `expiry`, `limits`, and `scopes`.
|
|
11
|
+
* `permissions` must name the access key's `expiry`, `limits`, and `scopes`.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
@@ -28,7 +28,7 @@ export declare function authorize<const chainId extends number = number>(auth: C
|
|
|
28
28
|
export declare namespace authorize {
|
|
29
29
|
type Options<chainId extends number = number> = {
|
|
30
30
|
/**
|
|
31
|
-
* The key to authorize. Defaults to a new key. Its `access` names the Tempo Account, which
|
|
31
|
+
* The access key to authorize. Defaults to a new access key. Its `access` names the Tempo Account, which
|
|
32
32
|
* defaults to the one the user selects at sign-in, or the user's oldest.
|
|
33
33
|
*/
|
|
34
34
|
accessKey?: Account.Account | undefined;
|
|
@@ -48,7 +48,7 @@ export declare namespace authorize {
|
|
|
48
48
|
*/
|
|
49
49
|
funding?: Funding.Funding | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* What the key may do. The grant always authorizes
|
|
51
|
+
* What the access key may do. The grant always authorizes an access key, so the app names its permissions, and
|
|
52
52
|
* the user approves them, so they may exceed the headless ceiling.
|
|
53
53
|
*/
|
|
54
54
|
permissions: Permissions<chainId>;
|
package/dist/actions/device.js
CHANGED
|
@@ -12,7 +12,7 @@ import { keyAuthorization } from '../internal/request.js';
|
|
|
12
12
|
* resolves with the authorization. The instance's `clientId` names the device app, such as
|
|
13
13
|
* `tempo-cli`, whose realms the sign-in uses. A CLI without a registration sends `cli:` and its
|
|
14
14
|
* name, such as `cli:acme-deploy`. The device page then shows its name as unverified, and its
|
|
15
|
-
* `permissions` must name the key's `expiry`, `limits`, and `scopes`.
|
|
15
|
+
* `permissions` must name the access key's `expiry`, `limits`, and `scopes`.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
@@ -30,7 +30,7 @@ import { keyAuthorization } from '../internal/request.js';
|
|
|
30
30
|
*/
|
|
31
31
|
export async function authorize(auth, options) {
|
|
32
32
|
const key = await AccessKey.resolve(options.accessKey);
|
|
33
|
-
// The device authorization request (RFC 8628 §3.1), with the key as base64url JSON.
|
|
33
|
+
// The device authorization request (RFC 8628 §3.1), with the access key as base64url JSON.
|
|
34
34
|
const code = await Api.json(await (auth.fetch ?? fetch)(new URL('/device/code', auth.url), {
|
|
35
35
|
body: new URLSearchParams({
|
|
36
36
|
...(options.challenge === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/actions/device.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE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B,QAAQ,EAAE,IAAI,CAAC,SAAS;QACxB,eAAe,EAAE,IAAI,CAAC,gBAAgB;QACtC,uBAAuB,EAAE,IAAI,CAAC,yBAAyB;QACvD,IAAI;KACL,CAAA;AACH,CAAC;AA6CD,gFAAgF;AAChF,MAAM,QAAQ,GAAG;IACf,aAAa,EAAE,8BAA8B;IAC7C,aAAa,EAAE,0CAA0C;CACjD,CAAA;AAOV;;;GAGG;AACH,SAAS,QAAQ;IACf,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAwB,CAAA;IACzE,MAAM,IAAI,GAAG,OAAO,EAAE,gBAAgB,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAA;IACtE,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAA;AACpD,CAAC"}
|
package/dist/actions/dialog.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Signs the user in on Tempo ID without leaving the app's page: in a frame of Tempo ID's embedded
|
|
3
3
|
* sign-in, which a dialog shows on the page, or in a popup window. Either way the page keeps the
|
|
4
|
-
* PKCE verifier and the key in memory, and redeems the code. Tempo ID's page in a popup posts the
|
|
4
|
+
* PKCE verifier and the access key in memory, and redeems the code. Tempo ID's page in a popup posts the
|
|
5
5
|
* callback to the page that opened it. On a page whose own `Cross-Origin-Opener-Policy` severs that
|
|
6
6
|
* handle, the popup returns to the redirect URI, whose page calls {@link callback}.
|
|
7
7
|
* @module
|
|
@@ -53,7 +53,7 @@ export declare function callback(auth: Config): Promise<boolean>;
|
|
|
53
53
|
* creates the client, unless its `preload` is `false`. Without it, the dialog shows once its frame
|
|
54
54
|
* loads.
|
|
55
55
|
*
|
|
56
|
-
* The frame loads without a request, so `signIn` takes it whatever its key, permissions, or
|
|
56
|
+
* The frame loads without a request, so `signIn` takes it whatever its access key, permissions, or
|
|
57
57
|
* challenge. Each sign-in keeps the frame loaded, and the next one posts its request to the same
|
|
58
58
|
* frame, which starts the sign-in again. Outside a secure context, and for an instance that pushes
|
|
59
59
|
* its requests with `par`, it loads nothing, since `signIn` then opens a popup. On a page that is
|
|
@@ -76,12 +76,12 @@ export declare namespace preload {
|
|
|
76
76
|
* - `iframe`, the default, shows Tempo ID's embedded sign-in in a dialog on the page: a compact
|
|
77
77
|
* modal, or a bottom sheet on a narrow screen. The dialog shows once its frame shows the request,
|
|
78
78
|
* at once after {@link preload}. The frame shows the approval page and the account step itself. A
|
|
79
|
-
* first-party app's key must fit the headless ceiling. When the frame cannot load, or the sign-in
|
|
79
|
+
* first-party app's access key must fit the headless ceiling. When the frame cannot load, or the sign-in
|
|
80
80
|
* needs a wallet upgrade, the dialog offers a popup, which the user's click opens. In a browser without
|
|
81
81
|
* IntersectionObserver v2, the call signs in with `popup` instead, unless the preloaded frame
|
|
82
82
|
* reported that Tempo ID trusts the app.
|
|
83
83
|
* - `popup` opens Tempo ID's pages in a popup window, with `display=popup`, so they show compact
|
|
84
|
-
* screens.
|
|
84
|
+
* screens. An access key may exceed the headless ceiling, since the approval page shows it.
|
|
85
85
|
*
|
|
86
86
|
* The page must be on the origin of the redirect URI, since the callback reaches the page only on
|
|
87
87
|
* that origin. Outside a secure context, `iframe` signs in with `popup`. An instance that pushes its
|
|
@@ -120,7 +120,7 @@ export declare namespace signIn {
|
|
|
120
120
|
*/
|
|
121
121
|
timeout?: number | undefined;
|
|
122
122
|
};
|
|
123
|
-
/** The authorization, without its key for a sign-in without `permissions`. */
|
|
123
|
+
/** The authorization, without its access key for a sign-in without `permissions`. */
|
|
124
124
|
type ReturnType<key extends boolean = false> = key extends false ? redirect.handleCallback.WithoutKey : Authorization;
|
|
125
125
|
}
|
|
126
126
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d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@@ -67,7 +67,7 @@ export async function callback(auth) {
|
|
|
67
67
|
* creates the client, unless its `preload` is `false`. Without it, the dialog shows once its frame
|
|
68
68
|
* loads.
|
|
69
69
|
*
|
|
70
|
-
* The frame loads without a request, so `signIn` takes it whatever its key, permissions, or
|
|
70
|
+
* The frame loads without a request, so `signIn` takes it whatever its access key, permissions, or
|
|
71
71
|
* challenge. Each sign-in keeps the frame loaded, and the next one posts its request to the same
|
|
72
72
|
* frame, which starts the sign-in again. Outside a secure context, and for an instance that pushes
|
|
73
73
|
* its requests with `par`, it loads nothing, since `signIn` then opens a popup. On a page that is
|
|
@@ -104,12 +104,12 @@ export function preload(auth, options = {}) {
|
|
|
104
104
|
* - `iframe`, the default, shows Tempo ID's embedded sign-in in a dialog on the page: a compact
|
|
105
105
|
* modal, or a bottom sheet on a narrow screen. The dialog shows once its frame shows the request,
|
|
106
106
|
* at once after {@link preload}. The frame shows the approval page and the account step itself. A
|
|
107
|
-
* first-party app's key must fit the headless ceiling. When the frame cannot load, or the sign-in
|
|
107
|
+
* first-party app's access key must fit the headless ceiling. When the frame cannot load, or the sign-in
|
|
108
108
|
* needs a wallet upgrade, the dialog offers a popup, which the user's click opens. In a browser without
|
|
109
109
|
* IntersectionObserver v2, the call signs in with `popup` instead, unless the preloaded frame
|
|
110
110
|
* reported that Tempo ID trusts the app.
|
|
111
111
|
* - `popup` opens Tempo ID's pages in a popup window, with `display=popup`, so they show compact
|
|
112
|
-
* screens.
|
|
112
|
+
* screens. An access key may exceed the headless ceiling, since the approval page shows it.
|
|
113
113
|
*
|
|
114
114
|
* The page must be on the origin of the redirect URI, since the callback reaches the page only on
|
|
115
115
|
* that origin. Outside a secure context, `iframe` signs in with `popup`. An instance that pushes its
|
package/dist/actions/email.d.ts
CHANGED
|
@@ -27,19 +27,19 @@ export declare namespace sendCode {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Signs the user in with an emailed code, and authorizes a first-party app in the same request. The
|
|
30
|
-
* key must fit the headless ceiling. A sign-in with
|
|
30
|
+
* access key must fit the headless ceiling. A sign-in with an access key creates the user's first Tempo Account.
|
|
31
31
|
*
|
|
32
|
-
* With `link`, the passkey of `Actions.passkey.signIn`'s email step signs again, and signs the key.
|
|
33
|
-
* In a browser, a passkey that owns the account signs the key on the page after the code.
|
|
32
|
+
* With `link`, the passkey of `Actions.passkey.signIn`'s email step signs again, and signs the access key.
|
|
33
|
+
* In a browser, a passkey that owns the account signs the access key on the page after the code.
|
|
34
34
|
*
|
|
35
35
|
* A refusal after the code verified has `signedIn: true`. Outside a browser, and without `getFn`,
|
|
36
36
|
* an account that a passkey owns throws `webauthn_required`. Another passkey's account, whose
|
|
37
37
|
* relying party does not cover the page, throws it too. Then authorize through
|
|
38
38
|
* `Actions.redirect.start`.
|
|
39
39
|
*
|
|
40
|
-
* A wallet.tempo passkey's account that waits for its upgrade signs the key as the passkey's own
|
|
41
|
-
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the key then upgrades
|
|
42
|
-
* the account with one more prompt, after Tempo ID registers the key.
|
|
40
|
+
* A wallet.tempo passkey's account that waits for its upgrade signs the access key as the passkey's own
|
|
41
|
+
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the access key then upgrades
|
|
42
|
+
* the account with one more prompt, after Tempo ID registers the access key.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```ts
|
|
@@ -50,7 +50,7 @@ export declare function signIn<const permissions extends Permissions | undefined
|
|
|
50
50
|
export declare namespace signIn {
|
|
51
51
|
type Options<permissions extends Permissions | undefined = Permissions | undefined> = {
|
|
52
52
|
/**
|
|
53
|
-
* The key to authorize. Defaults to a new key. Its `access` names the Tempo Account, which
|
|
53
|
+
* The access key to authorize. Defaults to a new access key. Its `access` names the Tempo Account, which
|
|
54
54
|
* defaults to the app's selected account, or the user's oldest.
|
|
55
55
|
*/
|
|
56
56
|
accessKey?: Account.Account | undefined;
|
|
@@ -61,7 +61,7 @@ export declare namespace signIn {
|
|
|
61
61
|
account?: Pick<AccountActions.get.Options, 'chain' | 'chainId' | 'getFn'> | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
|
|
64
|
-
* `tempo-id:sign` scope and
|
|
64
|
+
* `tempo-id:sign` scope and an access key.
|
|
65
65
|
*/
|
|
66
66
|
challenge?: ([permissions] extends [undefined] ? never : string) | undefined;
|
|
67
67
|
/** The 6-digit code that Tempo ID emailed. */
|
|
@@ -78,7 +78,7 @@ export declare namespace signIn {
|
|
|
78
78
|
* The call first runs the passkey's ceremony.
|
|
79
79
|
*/
|
|
80
80
|
link?: string | undefined;
|
|
81
|
-
/** What the key may do, which a request for
|
|
81
|
+
/** What the access key may do, which a request for an access key must name. Within the headless ceiling, unless the app holds `tempo-id:sign`. */
|
|
82
82
|
permissions?: permissions;
|
|
83
83
|
/**
|
|
84
84
|
* Whether to return passkey registration options as `registration`, in the same request as the
|
|
@@ -86,7 +86,7 @@ export declare namespace signIn {
|
|
|
86
86
|
*/
|
|
87
87
|
registration?: boolean | undefined;
|
|
88
88
|
};
|
|
89
|
-
/** The authorization, without its key for a sign-in without `permissions`, and whether its account can upgrade. */
|
|
89
|
+
/** The authorization, without its access key for a sign-in without `permissions`, and whether its account can upgrade. */
|
|
90
90
|
type ReturnType<chainId extends number = number, key extends boolean = false> = (key extends false ? Omit<Authorization<chainId>, 'accessKey' | 'key'> : Authorization<chainId>) & {
|
|
91
91
|
/**
|
|
92
92
|
* The user's Tempo Account, as `Actions.account.get` returns it, for a sign-in with `account`.
|
|
@@ -101,8 +101,8 @@ export declare namespace signIn {
|
|
|
101
101
|
*/
|
|
102
102
|
registration?: RegistrationOptions.Registration | undefined;
|
|
103
103
|
/**
|
|
104
|
-
* Whether the key's account is a wallet.tempo passkey's that waits for its upgrade on the key's
|
|
105
|
-
* chain. `Actions.account.upgrade` with the key upgrades it, and keeps the key.
|
|
104
|
+
* Whether the access key's account is a wallet.tempo passkey's that waits for its upgrade on the access key's
|
|
105
|
+
* chain. `Actions.account.upgrade` with the access key upgrades it, and keeps the access key.
|
|
106
106
|
*/
|
|
107
107
|
upgradeAvailable: boolean;
|
|
108
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/actions/email.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAc,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAA4B,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGxD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,KAAK,cAAc,MAAM,cAAc,CAAA;AAEnD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,QAAQ,CAAC,OAAO,GACxB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,KAAK,OAAO,GAAG;QACb,gCAAgC;QAChC,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,MAAM,CAC1B,KAAK,CAAC,WAAW,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,EAE7D,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GACnC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,CA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,KAAK,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;QACxD;;;WAGG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QACzB,kJAAkJ;QAClJ,WAAW,CAAC,EAAE,WAAW,CAAA;QACzB;;;WAGG;QACH,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KACnC,CAAA;IAED,0HAA0H;IAC1H,KAAK,UAAU,CACb,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,GAAG,SAAS,OAAO,GAAG,KAAK,IACzB,CAAC,GAAG,SAAS,KAAK,GAClB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,GACjD,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG;QAC5B;;;;;WAKG;QACH,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;QAClC;;;WAGG;QACH,YAAY,CAAC,EAAE,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAAA;QAC3D;;;WAGG;QACH,gBAAgB,EAAE,OAAO,CAAA;KAC1B,CAAA;CACF"}
|
package/dist/actions/email.js
CHANGED
|
@@ -20,19 +20,19 @@ export async function sendCode(auth, options) {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Signs the user in with an emailed code, and authorizes a first-party app in the same request. The
|
|
23
|
-
* key must fit the headless ceiling. A sign-in with
|
|
23
|
+
* access key must fit the headless ceiling. A sign-in with an access key creates the user's first Tempo Account.
|
|
24
24
|
*
|
|
25
|
-
* With `link`, the passkey of `Actions.passkey.signIn`'s email step signs again, and signs the key.
|
|
26
|
-
* In a browser, a passkey that owns the account signs the key on the page after the code.
|
|
25
|
+
* With `link`, the passkey of `Actions.passkey.signIn`'s email step signs again, and signs the access key.
|
|
26
|
+
* In a browser, a passkey that owns the account signs the access key on the page after the code.
|
|
27
27
|
*
|
|
28
28
|
* A refusal after the code verified has `signedIn: true`. Outside a browser, and without `getFn`,
|
|
29
29
|
* an account that a passkey owns throws `webauthn_required`. Another passkey's account, whose
|
|
30
30
|
* relying party does not cover the page, throws it too. Then authorize through
|
|
31
31
|
* `Actions.redirect.start`.
|
|
32
32
|
*
|
|
33
|
-
* A wallet.tempo passkey's account that waits for its upgrade signs the key as the passkey's own
|
|
34
|
-
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the key then upgrades
|
|
35
|
-
* the account with one more prompt, after Tempo ID registers the key.
|
|
33
|
+
* A wallet.tempo passkey's account that waits for its upgrade signs the access key as the passkey's own
|
|
34
|
+
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the access key then upgrades
|
|
35
|
+
* the account with one more prompt, after Tempo ID registers the access key.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```ts
|
|
@@ -41,13 +41,13 @@ export async function sendCode(auth, options) {
|
|
|
41
41
|
*/
|
|
42
42
|
export async function signIn(auth, options) {
|
|
43
43
|
const { code, email, getFn, link } = options;
|
|
44
|
-
// A challenge rides in the key, so a sign-in without one refuses it before it signs in.
|
|
44
|
+
// A challenge rides in the access key, so a sign-in without one refuses it before it signs in.
|
|
45
45
|
if (!options.permissions && options.challenge !== undefined)
|
|
46
46
|
throw new ChallengeWithoutKeyError();
|
|
47
47
|
// The authorization request rides with the sign-in, so one request signs in, creates the first
|
|
48
|
-
// account, and signs the key. The link's passkey signs again, so a page left at the email step
|
|
48
|
+
// account, and signs the access key. The link's passkey signs again, so a page left at the email step
|
|
49
49
|
// links nothing for the next person, who cannot sign with it. Its options carry the authorization
|
|
50
|
-
// request, so the same assertion signs the key.
|
|
50
|
+
// request, so the same assertion signs the access key.
|
|
51
51
|
const prepared = await Headless.prepare(auth, options);
|
|
52
52
|
const assertion = await (async () => {
|
|
53
53
|
if (!link)
|
|
@@ -84,7 +84,7 @@ export async function signIn(auth, options) {
|
|
|
84
84
|
? { assertion, link }
|
|
85
85
|
: {
|
|
86
86
|
authorize: prepared.authorize,
|
|
87
|
-
// A passkey that owns the account signs the key on this page, in place of a redirect.
|
|
87
|
+
// A passkey that owns the account signs the access key on this page, in place of a redirect.
|
|
88
88
|
...(Headless.steps(prepared.authorize, { getFn })
|
|
89
89
|
? { passkey: true }
|
|
90
90
|
: {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/actions/email.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAc,MAAM,aAAa,CAAA;AAExD,OAAO,EAAe,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAEhE,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAKlE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAY,EACZ,OAAyB;IAEzB,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;AAC1E,CAAC;AASD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAG1B,IAAY,EACZ,OAAoC;IAEpC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IAC5C
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/actions/email.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAc,MAAM,aAAa,CAAA;AAExD,OAAO,EAAe,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAEhE,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,C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