@tempoxyz/auth 0.0.0-pr-75.sha-5f3f31b → 0.0.0-pr-74.sha-9dae8aa
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/passkey.d.ts +2 -11
- package/dist/actions/passkey.js +4 -8
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Signs the user in with a passkey from the app's own sign-in form, and signs the app's key with the
|
|
3
|
-
* same assertion.
|
|
4
|
-
*
|
|
3
|
+
* same assertion. The browser offers every passkey it holds for Tempo's domain, so the app needs no
|
|
4
|
+
* email first.
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { Authentication } from 'ox/webauthn';
|
|
@@ -42,21 +42,12 @@ export declare namespace signIn {
|
|
|
42
42
|
* `tempo-auth:sign` scope may send one.
|
|
43
43
|
*/
|
|
44
44
|
challenge?: string | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* The credential ID, or up to 16 IDs, the browser offers. Each is unpadded base64url, as
|
|
47
|
-
* `PublicKeyCredential.id` reports it, of 1 to 1,023 bytes. A padded or otherwise non-canonical
|
|
48
|
-
* encoding throws a `RequestError` with reason `invalid_field`. Defaults to every passkey the
|
|
49
|
-
* browser holds for Tempo's domain, as an empty list does.
|
|
50
|
-
*/
|
|
51
|
-
credentialId?: readonly string[] | string | undefined;
|
|
52
45
|
/**
|
|
53
46
|
* Runs the WebAuthn ceremony in place of `navigator.credentials.get`, such as a native passkey
|
|
54
47
|
* module. Its assertion must report a web origin on the relying party's domain that the app
|
|
55
48
|
* registered, so an Android app's facet origin is refused.
|
|
56
49
|
*/
|
|
57
50
|
getFn?: Authentication.sign.Options['getFn'] | undefined;
|
|
58
|
-
/** How the browser mediates the ceremony, such as `conditional` for passkey autofill. Defaults to the browser's own mediation. */
|
|
59
|
-
mediation?: 'conditional' | 'optional' | 'required' | 'silent' | undefined;
|
|
60
51
|
/** What the key may do. It must fit the headless ceiling, which fills what it leaves out. */
|
|
61
52
|
permissions?: Permissions<chainId> | undefined;
|
|
62
53
|
};
|
package/dist/actions/passkey.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Signs the user in with a passkey from the app's own sign-in form, and signs the app's key with the
|
|
3
|
-
* same assertion.
|
|
4
|
-
*
|
|
3
|
+
* same assertion. The browser offers every passkey it holds for Tempo's domain, so the app needs no
|
|
4
|
+
* email first.
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { Authentication } from 'ox/webauthn';
|
|
@@ -29,7 +29,7 @@ import { request } from '../internal/request.js';
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export async function signIn(auth, options = {}) {
|
|
32
|
-
const { challenge,
|
|
32
|
+
const { challenge, getFn, permissions } = options;
|
|
33
33
|
const key = await AccessKey.resolve(options.accessKey);
|
|
34
34
|
const authorize = request(auth, {
|
|
35
35
|
accessKey: key.accessKey,
|
|
@@ -40,11 +40,7 @@ export async function signIn(auth, options = {}) {
|
|
|
40
40
|
// sends no `Origin` to bind one-tap to, so it sends the request with the assertion instead.
|
|
41
41
|
const native = !/^https?:/i.test(authorize.redirect_uri);
|
|
42
42
|
const requested = await Api.json(await Api.post(auth, '/v1/auth/passkey/options', {
|
|
43
|
-
json: {
|
|
44
|
-
...(native ? {} : { authorize }),
|
|
45
|
-
...(credentialId === undefined ? {} : { credentialId }),
|
|
46
|
-
...(mediation === undefined ? {} : { mediation }),
|
|
47
|
-
},
|
|
43
|
+
json: native ? {} : { authorize },
|
|
48
44
|
}));
|
|
49
45
|
const deserialized = Authentication.deserializeOptions(requested.options);
|
|
50
46
|
const assertion = Authentication.serializeResponse(await Authentication.sign(
|
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-74.sha-9dae8aa",
|
|
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": {
|