@tempoxyz/auth 0.0.0-pr-87.sha-226d5ea → 0.0.0-pr-96.sha-e74b8fa
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/Actions.d.ts +7 -7
- package/dist/Actions.js +4 -4
- package/dist/Decorator.js +4 -4
- package/dist/Step.d.ts +4 -4
- package/dist/actions/account.d.ts +4 -3
- package/dist/actions/account.js +4 -3
- package/dist/actions/email.d.ts +3 -3
- package/dist/actions/email.js +3 -3
- package/dist/internal/api.d.ts +2 -2
- package/package.json +1 -1
package/dist/Actions.d.ts
CHANGED
|
@@ -19,10 +19,10 @@ export * as provider from './actions/provider.ts';
|
|
|
19
19
|
export * as realm from './actions/realm.ts';
|
|
20
20
|
export * as redirect from './actions/redirect.ts';
|
|
21
21
|
/**
|
|
22
|
-
* Authorizes the app for a user already signed in to Tempo Auth, from any app. Returns
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Authorizes the app for a user already signed in to Tempo Auth, from any app. Returns `undefined`
|
|
23
|
+
* without a session, so the app shows sign-in. The key must fit Tempo Auth's headless ceiling. An
|
|
24
|
+
* `account` that the call names becomes the app's account for its later requests, such as the
|
|
25
|
+
* account the user selected in a sign-in's account step.
|
|
26
26
|
*
|
|
27
27
|
* A passkey-owned account signs the key with a passkey prompt on the page, when the page is the
|
|
28
28
|
* app's own on Tempo's domain. Elsewhere the call throws a `RequestError` with reason
|
|
@@ -43,9 +43,9 @@ export declare namespace authorize {
|
|
|
43
43
|
*/
|
|
44
44
|
accessKey?: Account.Account | undefined;
|
|
45
45
|
/**
|
|
46
|
-
* The address of the user's Tempo Account the key acts for, such as the
|
|
47
|
-
* a sign-in's account step. Takes the place of `accessKey`'s `access`, and becomes
|
|
48
|
-
* account for its later requests that name none.
|
|
46
|
+
* The address of the user's Tempo Account the key acts for, such as the account the user
|
|
47
|
+
* selected in a sign-in's account step. Takes the place of `accessKey`'s `access`, and becomes
|
|
48
|
+
* the app's account for its later requests that name none.
|
|
49
49
|
*/
|
|
50
50
|
account?: `0x${string}` | undefined;
|
|
51
51
|
/**
|
package/dist/Actions.js
CHANGED
|
@@ -17,10 +17,10 @@ export * as provider from './actions/provider.js';
|
|
|
17
17
|
export * as realm from './actions/realm.js';
|
|
18
18
|
export * as redirect from './actions/redirect.js';
|
|
19
19
|
/**
|
|
20
|
-
* Authorizes the app for a user already signed in to Tempo Auth, from any app. Returns
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* Authorizes the app for a user already signed in to Tempo Auth, from any app. Returns `undefined`
|
|
21
|
+
* without a session, so the app shows sign-in. The key must fit Tempo Auth's headless ceiling. An
|
|
22
|
+
* `account` that the call names becomes the app's account for its later requests, such as the
|
|
23
|
+
* account the user selected in a sign-in's account step.
|
|
24
24
|
*
|
|
25
25
|
* A passkey-owned account signs the key with a passkey prompt on the page, when the page is the
|
|
26
26
|
* app's own on Tempo's domain. Elsewhere the call throws a `RequestError` with reason
|
package/dist/Decorator.js
CHANGED
|
@@ -129,8 +129,8 @@ export function tempoAuth(options) {
|
|
|
129
129
|
const result = await Actions.email
|
|
130
130
|
.signIn(auth, options)
|
|
131
131
|
.catch(change.fail);
|
|
132
|
-
// An account step follows a sign-in as another user, who has not
|
|
133
|
-
// newer change, such as sign-out, overtaking it ends the session the step set.
|
|
132
|
+
// An account step follows a sign-in as another user, who has not selected an account
|
|
133
|
+
// yet. A newer change, such as sign-out, overtaking it ends the session the step set.
|
|
134
134
|
if ('step' in result && result.step.type === 'account') {
|
|
135
135
|
await change.check();
|
|
136
136
|
await change.apply(undefined);
|
|
@@ -154,8 +154,8 @@ export function tempoAuth(options) {
|
|
|
154
154
|
const result = await Actions.passkey
|
|
155
155
|
.signIn(auth, options)
|
|
156
156
|
.catch(change.fail);
|
|
157
|
-
// An account step follows a sign-in as another user, who has not
|
|
158
|
-
// newer change, such as sign-out, overtaking it ends the session the step set.
|
|
157
|
+
// An account step follows a sign-in as another user, who has not selected an account
|
|
158
|
+
// yet. A newer change, such as sign-out, overtaking it ends the session the step set.
|
|
159
159
|
if ('step' in result && result.step.type === 'account') {
|
|
160
160
|
await change.check();
|
|
161
161
|
await change.apply(undefined);
|
package/dist/Step.d.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { TempoAccount } from './TempoAccount.ts';
|
|
6
6
|
/**
|
|
7
|
-
* A step a sign-in needs before it finishes
|
|
8
|
-
*
|
|
7
|
+
* A step that a sign-in needs before it finishes. It is the SSO connection that an address
|
|
8
|
+
* requires, or the account selection for a user with more than one Tempo Account.
|
|
9
9
|
*/
|
|
10
10
|
export type Step = {
|
|
11
11
|
/** The user's Tempo Accounts: the one the browser selected before first, then oldest first. */
|
|
12
12
|
accounts: readonly TempoAccount[];
|
|
13
13
|
/**
|
|
14
|
-
* The kind of step. The user is signed in
|
|
15
|
-
* `
|
|
14
|
+
* The kind of step. The user is signed in and selects an account. `Actions.authorize` takes
|
|
15
|
+
* its `address` as `account`.
|
|
16
16
|
*/
|
|
17
17
|
type: 'account';
|
|
18
18
|
} | {
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import type { Auth } from '../Auth.ts';
|
|
6
6
|
import type { TempoAccount } from '../TempoAccount.ts';
|
|
7
7
|
/**
|
|
8
|
-
* Returns the signed-in user's Tempo Account for the app, with its `realm
|
|
9
|
-
* sign-in or last named in `Actions.authorize
|
|
10
|
-
*
|
|
8
|
+
* Returns the signed-in user's Tempo Account for the app, with its `realm`. The account is the one
|
|
9
|
+
* selected at sign-in or last named in `Actions.authorize`. Otherwise it is the oldest account of
|
|
10
|
+
* the user in the app's realms. A user with no account in those realms receives one in the first
|
|
11
|
+
* realm.
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
13
14
|
* ```ts
|
package/dist/actions/account.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as Api from '../internal/api.js';
|
|
2
2
|
/**
|
|
3
|
-
* Returns the signed-in user's Tempo Account for the app, with its `realm
|
|
4
|
-
* sign-in or last named in `Actions.authorize
|
|
5
|
-
*
|
|
3
|
+
* Returns the signed-in user's Tempo Account for the app, with its `realm`. The account is the one
|
|
4
|
+
* selected at sign-in or last named in `Actions.authorize`. Otherwise it is the oldest account of
|
|
5
|
+
* the user in the app's realms. A user with no account in those realms receives one in the first
|
|
6
|
+
* realm.
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
9
|
* ```ts
|
package/dist/actions/email.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export declare namespace sendCode {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Signs the user in with the code they were emailed, and authorizes the app in the same call.
|
|
27
|
-
* Returns a {@link Step} when the address requires SSO, which `Actions.provider.signIn` continues
|
|
28
|
-
*
|
|
29
|
-
* as `account`.
|
|
27
|
+
* Returns a {@link Step} when the address requires SSO, which `Actions.provider.signIn` continues.
|
|
28
|
+
* It also returns one when the user has more than one Tempo Account. `Actions.authorize` then takes
|
|
29
|
+
* the `address` of the selected account as `account`.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
package/dist/actions/email.js
CHANGED
|
@@ -15,9 +15,9 @@ export async function sendCode(auth, options) {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Signs the user in with the code they were emailed, and authorizes the app in the same call.
|
|
18
|
-
* Returns a {@link Step} when the address requires SSO, which `Actions.provider.signIn` continues
|
|
19
|
-
*
|
|
20
|
-
* as `account`.
|
|
18
|
+
* Returns a {@link Step} when the address requires SSO, which `Actions.provider.signIn` continues.
|
|
19
|
+
* It also returns one when the user has more than one Tempo Account. `Actions.authorize` then takes
|
|
20
|
+
* the `address` of the selected account as `account`.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
package/dist/internal/api.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export declare function authorization<chainId extends number = number>(body: Hea
|
|
|
15
15
|
material: Key.Material;
|
|
16
16
|
}): Authorization<chainId>;
|
|
17
17
|
/**
|
|
18
|
-
* A sign-in's account step as the API returns it
|
|
19
|
-
* selects one before
|
|
18
|
+
* A sign-in's account step, as the API returns it. It lists the accounts of a user with more than
|
|
19
|
+
* one, who selects one before the key is authorized.
|
|
20
20
|
*/
|
|
21
21
|
export type AccountStep = {
|
|
22
22
|
accounts: readonly TempoAccountResponse[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempoxyz/auth",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-96.sha-e74b8fa",
|
|
4
4
|
"description": "Signs users in to Tempo through Tempo Auth, and returns Viem access key accounts on their Tempo Accounts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|