@passlock/client 2.0.2 → 2.0.4
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/index.d.ts +38 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -35
- package/dist/index.js.map +1 -1
- package/dist/internal/network.d.ts +1 -1
- package/dist/internal/network.d.ts.map +1 -1
- package/dist/internal/network.js +6 -4
- package/dist/internal/network.js.map +1 -1
- package/dist/logger.js +4 -4
- package/dist/logger.js.map +1 -1
- package/dist/passkey/authentication/authentication.d.ts +28 -17
- package/dist/passkey/authentication/authentication.d.ts.map +1 -1
- package/dist/passkey/authentication/authentication.js +7 -7
- package/dist/passkey/authentication/authentication.js.map +1 -1
- package/dist/passkey/errors.d.ts +9 -16
- package/dist/passkey/errors.d.ts.map +1 -1
- package/dist/passkey/errors.js +10 -17
- package/dist/passkey/errors.js.map +1 -1
- package/dist/passkey/registration/registration.d.ts +19 -15
- package/dist/passkey/registration/registration.d.ts.map +1 -1
- package/dist/passkey/registration/registration.js +7 -4
- package/dist/passkey/registration/registration.js.map +1 -1
- package/dist/passkey/shared.d.ts +2 -0
- package/dist/passkey/shared.d.ts.map +1 -1
- package/dist/passkey/signals/signals.d.ts +76 -19
- package/dist/passkey/signals/signals.d.ts.map +1 -1
- package/dist/passkey/signals/signals.js +67 -26
- package/dist/passkey/signals/signals.js.map +1 -1
- package/dist/principal.d.ts +3 -0
- package/dist/principal.d.ts.map +1 -1
- package/dist/safe.d.ts +75 -55
- package/dist/safe.d.ts.map +1 -1
- package/dist/safe.js +71 -50
- package/dist/safe.js.map +1 -1
- package/package.json +6 -9
- package/dist/errors.d.ts +0 -4
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -14
- package/dist/errors.js.map +0 -1
|
@@ -6,40 +6,39 @@ import { Endpoint, TenancyId } from "../../internal";
|
|
|
6
6
|
import type { NetworkError } from "../../internal/network";
|
|
7
7
|
import { Logger } from "../../logger";
|
|
8
8
|
import type { PasslockOptions } from "../../options";
|
|
9
|
-
import {
|
|
9
|
+
import { OrphanedPasskeyError, OtherPasskeyError, PasskeyUnsupportedError } from "../errors";
|
|
10
10
|
import type { Millis, UserVerification } from "../shared";
|
|
11
11
|
/**
|
|
12
12
|
* Passkey authentication options
|
|
13
13
|
*
|
|
14
|
+
* @see {@link authenticatePasskey}
|
|
15
|
+
*
|
|
14
16
|
* @category Passkeys (core)
|
|
15
17
|
*/
|
|
16
18
|
export interface AuthenticationOptions extends PasslockOptions {
|
|
17
19
|
/**
|
|
18
20
|
* Restrict the passkey(s) the device presents to the user to a given set
|
|
19
21
|
*
|
|
20
|
-
* @see {@link https://passlock.dev/passkeys/allow-credentials
|
|
22
|
+
* @see {@link https://passlock.dev/passkeys/allow-credentials/ allowCredentials (main docs)}
|
|
21
23
|
*/
|
|
22
24
|
allowCredentials?: Array<string> | undefined;
|
|
23
25
|
/**
|
|
24
26
|
* Whether the device should re-authenticate the user locally before
|
|
25
27
|
* authenticating with a passkey.
|
|
26
28
|
*
|
|
27
|
-
* @see {@link https://passlock.dev/passkeys/user-verification
|
|
29
|
+
* @see {@link https://passlock.dev/passkeys/user-verification/ userVerification (main docs)}
|
|
28
30
|
*/
|
|
29
31
|
userVerification?: UserVerification | undefined;
|
|
30
32
|
/**
|
|
31
33
|
* Use browser autofill.
|
|
32
34
|
*
|
|
33
|
-
* @see {@link https://passlock.dev/passkeys/autofill
|
|
35
|
+
* @see {@link https://passlock.dev/passkeys/autofill/ autofill (main docs)}
|
|
34
36
|
*/
|
|
35
37
|
autofill?: boolean | undefined;
|
|
36
38
|
/**
|
|
37
39
|
* Receive notifications about key stages in the authentication process.
|
|
38
40
|
* For example, you might use event notifications to toggle loading icons or
|
|
39
41
|
* to disable certain form fields.
|
|
40
|
-
*
|
|
41
|
-
* @param event
|
|
42
|
-
* @returns Nothing.
|
|
43
42
|
*/
|
|
44
43
|
onEvent?: OnAuthenticationEvent | undefined;
|
|
45
44
|
/**
|
|
@@ -51,12 +50,12 @@ export declare const AuthenticationSuccessTag: "AuthenticationSuccess";
|
|
|
51
50
|
export type AuthenticationSuccessTag = typeof AuthenticationSuccessTag;
|
|
52
51
|
/**
|
|
53
52
|
* Represents the outcome of a successful passkey authentication.
|
|
54
|
-
* Submit the code and/or id_token to your backend, then either
|
|
55
|
-
* exchange the code with the
|
|
56
|
-
* verify the id_token (JWT).
|
|
53
|
+
* Submit the `code` and/or `id_token` to your backend, then either
|
|
54
|
+
* exchange the code with the Passlock REST API or decode and
|
|
55
|
+
* verify the id_token (JWT). **note:** The @passlock/node library
|
|
56
|
+
* includes utilities for this.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
* this for you.
|
|
58
|
+
* @see {@link isAuthenticationSuccess}
|
|
60
59
|
*
|
|
61
60
|
* @category Passkeys (core)
|
|
62
61
|
*/
|
|
@@ -83,7 +82,7 @@ export type AuthenticationSuccess = {
|
|
|
83
82
|
code: string;
|
|
84
83
|
};
|
|
85
84
|
/**
|
|
86
|
-
* Type guard to narrow something down to an AuthenticationSuccess
|
|
85
|
+
* Type guard to narrow something down to an {@link AuthenticationSuccess}
|
|
87
86
|
*
|
|
88
87
|
* @param payload
|
|
89
88
|
* @returns `true` if the payload is an {@link AuthenticationSuccess}.
|
|
@@ -103,13 +102,13 @@ export declare const startAuthentication: (optionsJSON: PublicKeyCredentialReque
|
|
|
103
102
|
}) => Micro.Micro<Helper.AuthenticationResponseJSON, PasskeyUnsupportedError | OtherPasskeyError, Logger | AuthenticationHelper>;
|
|
104
103
|
export declare const verifyCredential: (sessionToken: string, response: AuthenticationResponseJSON, { onEvent }: {
|
|
105
104
|
onEvent?: OnAuthenticationEvent | undefined;
|
|
106
|
-
}) => Micro.Micro<AuthenticationSuccess, NetworkError |
|
|
105
|
+
}) => Micro.Micro<AuthenticationSuccess, NetworkError | OrphanedPasskeyError, Endpoint | TenancyId | Logger>;
|
|
107
106
|
/**
|
|
108
107
|
* Potential errors associated with Passkey authentication
|
|
109
108
|
*
|
|
110
109
|
* @category Passkeys (errors)
|
|
111
110
|
*/
|
|
112
|
-
export type AuthenticationError = PasskeyUnsupportedError | OtherPasskeyError |
|
|
111
|
+
export type AuthenticationError = PasskeyUnsupportedError | OtherPasskeyError | OrphanedPasskeyError | NetworkError;
|
|
113
112
|
/**
|
|
114
113
|
* Trigger local passkey authentication then verify the passkey in your Passlock vault.
|
|
115
114
|
* Returns a code and id_token that can be exchanged/decoded in your backend.
|
|
@@ -121,13 +120,25 @@ export type AuthenticationError = PasskeyUnsupportedError | OtherPasskeyError |
|
|
|
121
120
|
export declare const authenticatePasskey: (options: AuthenticationOptions) => Micro.Micro<AuthenticationSuccess, AuthenticationError, Logger | AuthenticationHelper>;
|
|
122
121
|
/**
|
|
123
122
|
* Type of the authentication event
|
|
123
|
+
*
|
|
124
|
+
* @category Passkeys (other)
|
|
124
125
|
*/
|
|
125
|
-
export declare const
|
|
126
|
+
export declare const AuthenticationEvents: readonly ["optionsRequest", "getCredential", "verifyCredential"];
|
|
126
127
|
/**
|
|
128
|
+
* Type of the authentication event
|
|
129
|
+
*
|
|
127
130
|
* @category Passkeys (other)
|
|
128
131
|
*/
|
|
129
|
-
export type AuthenticationEvent =
|
|
132
|
+
export type AuthenticationEvent = "optionsRequest" | "getCredential" | "verifyCredential";
|
|
130
133
|
/**
|
|
134
|
+
* Allows you to hook into key lifecycle events.
|
|
135
|
+
*
|
|
136
|
+
* Most commonly used when {@link authenticatePasskey}
|
|
137
|
+
* is called with {@link AuthenticationOptions#autofill}.
|
|
138
|
+
* When autofill is applied the browser will wait for user interaction. By listening
|
|
139
|
+
* for the `verifyCredential` {@link AuthenticationEvent} you know when the user has
|
|
140
|
+
* presented a passkey so you can disable forms/toggle loading icons etc.
|
|
141
|
+
*
|
|
131
142
|
* @category Passkeys (other)
|
|
132
143
|
*/
|
|
133
144
|
export type OnAuthenticationEvent = (event: AuthenticationEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/passkey/authentication/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAA;AACjD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,qCAAqC,EAE3C,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAW,KAAK,EAAQ,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAA6B,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EACL,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/passkey/authentication/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAA;AACjD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,qCAAqC,EAE3C,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAW,KAAK,EAAQ,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAA6B,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB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A;IAC3B,OAAO,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAA;CAC5C,+HAiCC,CAAA;AA6BJ,eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,EACpB,UAAU,0BAA0B,EACpC,aAAa;IAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAA;CAAE,2GAsC1D,CAAA;AAEJ;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,YAAY,CAAA;AAEhB;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,qBAAqB,KAC7B,KAAK,CAAC,KAAK,CACZ,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,GAAG,oBAAoB,CAkC9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kEAIvB,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,CAAA;AAEtB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { WebAuthnError, } from "@simplewebauthn/browser";
|
|
|
3
3
|
import { Context, Micro, pipe } from "effect";
|
|
4
4
|
import { Endpoint, makeEndpoint, makeRequest, TenancyId } from "../../internal";
|
|
5
5
|
import { Logger } from "../../logger";
|
|
6
|
-
import {
|
|
6
|
+
import { OrphanedPasskeyError, OtherPasskeyError, PasskeyUnsupportedError, } from "../errors";
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
* @hidden
|
|
@@ -16,7 +16,7 @@ export class AuthenticationHelper extends Context.Tag("AuthenticationHelper")()
|
|
|
16
16
|
}
|
|
17
17
|
export const AuthenticationSuccessTag = "AuthenticationSuccess";
|
|
18
18
|
/**
|
|
19
|
-
* Type guard to narrow something down to an AuthenticationSuccess
|
|
19
|
+
* Type guard to narrow something down to an {@link AuthenticationSuccess}
|
|
20
20
|
*
|
|
21
21
|
* @param payload
|
|
22
22
|
* @returns `true` if the payload is an {@link AuthenticationSuccess}.
|
|
@@ -32,9 +32,7 @@ export const isAuthenticationSuccess = (payload) => {
|
|
|
32
32
|
return false;
|
|
33
33
|
if (typeof payload._tag !== "string")
|
|
34
34
|
return false;
|
|
35
|
-
|
|
36
|
-
return false;
|
|
37
|
-
return true;
|
|
35
|
+
return payload._tag === AuthenticationSuccessTag;
|
|
38
36
|
};
|
|
39
37
|
export const fetchOptions = (options) => Micro.gen(function* () {
|
|
40
38
|
const logger = yield* Micro.service(Logger);
|
|
@@ -142,7 +140,7 @@ export const verifyCredential = (sessionToken, response, { onEvent }) => Micro.g
|
|
|
142
140
|
payload,
|
|
143
141
|
responsePredicate: isAuthenticationSuccess,
|
|
144
142
|
url,
|
|
145
|
-
}), Micro.catchTag("@error/PasskeyNotFound", (err) => Micro.fail(new
|
|
143
|
+
}), Micro.catchTag("@error/PasskeyNotFound", (err) => Micro.fail(new OrphanedPasskeyError(err))));
|
|
146
144
|
yield* logger.logInfo(`Passkey with id ${authenticationResponse.principal.authenticatorId} successfully authenticated`);
|
|
147
145
|
return authenticationResponse;
|
|
148
146
|
});
|
|
@@ -181,8 +179,10 @@ export const authenticatePasskey = (options) => {
|
|
|
181
179
|
};
|
|
182
180
|
/**
|
|
183
181
|
* Type of the authentication event
|
|
182
|
+
*
|
|
183
|
+
* @category Passkeys (other)
|
|
184
184
|
*/
|
|
185
|
-
export const
|
|
185
|
+
export const AuthenticationEvents = [
|
|
186
186
|
"optionsRequest",
|
|
187
187
|
"getCredential",
|
|
188
188
|
"verifyCredential",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/passkey/authentication/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAGL,aAAa,GACd,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EACL,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/passkey/authentication/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAGL,aAAa,GACd,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,WAAW,CAAA;AA8ClB;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAM1E;IACD,MAAM,CAAC,OAAO,GAAG;QACf,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;QACvD,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;KACF,CAAA;;AAGjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAgC,CAAA;AAwCxE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAAgB,EACkB,EAAE;IACpC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAElC,IAAI,CAAC,C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,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACzC,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,gBAAgB;IAChB,eAAe;IACf,kBAAkB;CACV,CAAA"}
|
package/dist/passkey/errors.d.ts
CHANGED
|
@@ -12,12 +12,11 @@ export declare const isPasskeyUnsupportedError: (payload: unknown) => payload is
|
|
|
12
12
|
* @category Passkeys (errors)
|
|
13
13
|
*/
|
|
14
14
|
export declare class PasskeyUnsupportedError extends Error {
|
|
15
|
-
readonly _tag: "PasskeyUnsupported";
|
|
15
|
+
readonly _tag: "@error/PasskeyUnsupported";
|
|
16
16
|
readonly message: string;
|
|
17
17
|
constructor({ message }: {
|
|
18
18
|
message: string;
|
|
19
19
|
});
|
|
20
|
-
static isPasskeyUnsupportedError: (payload: unknown) => payload is PasskeyUnsupportedError;
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* Client tried to authenticate with a passkey that was not found in the vault.
|
|
@@ -28,7 +27,7 @@ export declare class PasskeyUnsupportedError extends Error {
|
|
|
28
27
|
*
|
|
29
28
|
* @category Passkeys (errors)
|
|
30
29
|
*/
|
|
31
|
-
export declare const
|
|
30
|
+
export declare const isOrphanedPasskeyError: (payload: unknown) => payload is OrphanedPasskeyError;
|
|
32
31
|
/**
|
|
33
32
|
* Client tried to authenticate with a passkey that was not found in the vault.
|
|
34
33
|
* Note: this error can be passed to the {@link deletePasskey} function. This is
|
|
@@ -38,8 +37,8 @@ export declare const isPasskeyNotFoundError: (payload: unknown) => payload is Pa
|
|
|
38
37
|
*
|
|
39
38
|
* @category Passkeys (errors)
|
|
40
39
|
*/
|
|
41
|
-
export declare class
|
|
42
|
-
readonly _tag: "
|
|
40
|
+
export declare class OrphanedPasskeyError extends Error {
|
|
41
|
+
readonly _tag: "@error/OrphanedPasskey";
|
|
43
42
|
readonly message: string;
|
|
44
43
|
readonly credentialId: string;
|
|
45
44
|
readonly rpId: string;
|
|
@@ -48,7 +47,6 @@ export declare class PasskeyNotFoundError extends Error {
|
|
|
48
47
|
credentialId: string;
|
|
49
48
|
rpId: string;
|
|
50
49
|
});
|
|
51
|
-
static isPasskeyNotFoundError: (payload: unknown) => payload is PasskeyNotFoundError;
|
|
52
50
|
}
|
|
53
51
|
export type ErrorCode = "ERROR_CEREMONY_ABORTED" | "ERROR_INVALID_DOMAIN" | "ERROR_INVALID_RP_ID" | "ERROR_INVALID_USER_ID_LENGTH" | "ERROR_MALFORMED_PUBKEYCREDPARAMS" | "ERROR_AUTHENTICATOR_GENERAL_ERROR" | "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT" | "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT" | "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED" | "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG" | "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE" | "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY";
|
|
54
52
|
/**
|
|
@@ -65,7 +63,7 @@ export declare const isOtherPasskeyError: (payload: unknown) => payload is Other
|
|
|
65
63
|
* @category Passkeys (errors)
|
|
66
64
|
*/
|
|
67
65
|
export declare class OtherPasskeyError extends Error {
|
|
68
|
-
readonly _tag: "OtherPasskey";
|
|
66
|
+
readonly _tag: "@error/OtherPasskey";
|
|
69
67
|
readonly error: unknown;
|
|
70
68
|
readonly message: string;
|
|
71
69
|
readonly code?: ErrorCode;
|
|
@@ -76,7 +74,6 @@ export declare class OtherPasskeyError extends Error {
|
|
|
76
74
|
code?: ErrorCode;
|
|
77
75
|
cause?: unknown;
|
|
78
76
|
});
|
|
79
|
-
static isOtherPasskeyError: (payload: unknown) => payload is OtherPasskeyError;
|
|
80
77
|
}
|
|
81
78
|
/**
|
|
82
79
|
* Raised if excludeCredentials was provided and the device
|
|
@@ -94,12 +91,11 @@ export declare const isDuplicatePasskeyError: (payload: unknown) => payload is D
|
|
|
94
91
|
* @category Passkeys (errors)
|
|
95
92
|
*/
|
|
96
93
|
export declare class DuplicatePasskeyError extends Error {
|
|
97
|
-
readonly _tag: "
|
|
94
|
+
readonly _tag: "@error/DuplicatePasskey";
|
|
98
95
|
readonly message: string;
|
|
99
96
|
constructor({ message }: {
|
|
100
97
|
message: string;
|
|
101
98
|
});
|
|
102
|
-
static isDuplicatePasskeyError: (payload: unknown) => payload is DuplicatePasskeyError;
|
|
103
99
|
}
|
|
104
100
|
/**
|
|
105
101
|
* The browser/device was unable to delete the passkey
|
|
@@ -113,14 +109,13 @@ export declare const isDeleteError: (payload: unknown) => payload is DeleteError
|
|
|
113
109
|
* @category Passkeys (errors)
|
|
114
110
|
*/
|
|
115
111
|
export declare class DeleteError extends Error {
|
|
116
|
-
readonly _tag: "
|
|
112
|
+
readonly _tag: "@error/Delete";
|
|
117
113
|
readonly message: string;
|
|
118
114
|
readonly code: "PASSKEY_DELETION_UNSUPPORTED" | "PASSKEY_NOT_FOUND" | "OTHER_ERROR";
|
|
119
115
|
constructor({ message, code, }: {
|
|
120
116
|
message: string;
|
|
121
117
|
code: "PASSKEY_DELETION_UNSUPPORTED" | "PASSKEY_NOT_FOUND" | "OTHER_ERROR";
|
|
122
118
|
});
|
|
123
|
-
static isDeleteError: (payload: unknown) => payload is DeleteError;
|
|
124
119
|
}
|
|
125
120
|
/**
|
|
126
121
|
* The browser/device was unable to prune the passkeys
|
|
@@ -134,14 +129,13 @@ export declare const isPruningError: (payload: unknown) => payload is PruningErr
|
|
|
134
129
|
* @category Passkeys (errors)
|
|
135
130
|
*/
|
|
136
131
|
export declare class PruningError extends Error {
|
|
137
|
-
readonly _tag: "
|
|
132
|
+
readonly _tag: "@error/Pruning";
|
|
138
133
|
readonly message: string;
|
|
139
134
|
readonly code: "PASSKEY_PRUNING_UNSUPPORTED" | "OTHER_ERROR";
|
|
140
135
|
constructor({ message, code, }: {
|
|
141
136
|
message: string;
|
|
142
137
|
code: "PASSKEY_PRUNING_UNSUPPORTED" | "OTHER_ERROR";
|
|
143
138
|
});
|
|
144
|
-
static isPruningError: (payload: unknown) => payload is PruningError;
|
|
145
139
|
}
|
|
146
140
|
/**
|
|
147
141
|
* The browser/device was unable to update the local passkey
|
|
@@ -155,13 +149,12 @@ export declare const isUpdateError: (payload: unknown) => payload is UpdateError
|
|
|
155
149
|
* @category Passkeys (errors)
|
|
156
150
|
*/
|
|
157
151
|
export declare class UpdateError extends Error {
|
|
158
|
-
readonly _tag: "
|
|
152
|
+
readonly _tag: "@error/Update";
|
|
159
153
|
readonly message: string;
|
|
160
154
|
readonly code: "PASSKEY_UPDATE_UNSUPPORTED" | "OTHER_ERROR";
|
|
161
155
|
constructor({ message, code, }: {
|
|
162
156
|
message: string;
|
|
163
157
|
code: "PASSKEY_UPDATE_UNSUPPORTED" | "OTHER_ERROR";
|
|
164
158
|
});
|
|
165
|
-
static isUpdateError: (payload: unknown) => payload is UpdateError;
|
|
166
159
|
}
|
|
167
160
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/passkey/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GACpC,SAAS,OAAO,KACf,OAAO,IAAI,uBAIb,CAAA;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,EAAG,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/passkey/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GACpC,SAAS,OAAO,KACf,OAAO,IAAI,uBAIb,CAAA;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,EAAG,2BAA2B,CAAS;IACpD,QAAQ,CAAC,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AI,EAAE,6BAA6B,GAAG,aAAa,CAAA;KAAE;CAK5E;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,WAI3D,CAAA;AAED;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAS;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,4BAA4B,GAAG,aAAa,CAAA;gBAE/C,EACV,OAAO,EACP,IAAI,GACL,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,4BAA4B,GAAG,aAAa,CAAA;KAAE;CAK3E"}
|
package/dist/passkey/errors.js
CHANGED
|
@@ -18,13 +18,12 @@ export const isPasskeyUnsupportedError = (payload) => {
|
|
|
18
18
|
* @category Passkeys (errors)
|
|
19
19
|
*/
|
|
20
20
|
export class PasskeyUnsupportedError extends Error {
|
|
21
|
-
_tag = "PasskeyUnsupported";
|
|
21
|
+
_tag = "@error/PasskeyUnsupported";
|
|
22
22
|
message;
|
|
23
23
|
constructor({ message }) {
|
|
24
24
|
super();
|
|
25
25
|
this.message = message;
|
|
26
26
|
}
|
|
27
|
-
static isPasskeyUnsupportedError = isPasskeyUnsupportedError;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Client tried to authenticate with a passkey that was not found in the vault.
|
|
@@ -35,12 +34,12 @@ export class PasskeyUnsupportedError extends Error {
|
|
|
35
34
|
*
|
|
36
35
|
* @category Passkeys (errors)
|
|
37
36
|
*/
|
|
38
|
-
export const
|
|
37
|
+
export const isOrphanedPasskeyError = (payload) => {
|
|
39
38
|
if (typeof payload !== "object")
|
|
40
39
|
return false;
|
|
41
40
|
if (payload === null)
|
|
42
41
|
return false;
|
|
43
|
-
return payload instanceof
|
|
42
|
+
return payload instanceof OrphanedPasskeyError;
|
|
44
43
|
};
|
|
45
44
|
/**
|
|
46
45
|
* Client tried to authenticate with a passkey that was not found in the vault.
|
|
@@ -51,8 +50,8 @@ export const isPasskeyNotFoundError = (payload) => {
|
|
|
51
50
|
*
|
|
52
51
|
* @category Passkeys (errors)
|
|
53
52
|
*/
|
|
54
|
-
export class
|
|
55
|
-
_tag = "
|
|
53
|
+
export class OrphanedPasskeyError extends Error {
|
|
54
|
+
_tag = "@error/OrphanedPasskey";
|
|
56
55
|
message;
|
|
57
56
|
credentialId;
|
|
58
57
|
rpId;
|
|
@@ -62,7 +61,6 @@ export class PasskeyNotFoundError extends Error {
|
|
|
62
61
|
this.credentialId = credentialId;
|
|
63
62
|
this.rpId = rpId;
|
|
64
63
|
}
|
|
65
|
-
static isPasskeyNotFoundError = isPasskeyNotFoundError;
|
|
66
64
|
}
|
|
67
65
|
/**
|
|
68
66
|
* An unexpected passkey specific error occurred.
|
|
@@ -84,7 +82,7 @@ export const isOtherPasskeyError = (payload) => {
|
|
|
84
82
|
* @category Passkeys (errors)
|
|
85
83
|
*/
|
|
86
84
|
export class OtherPasskeyError extends Error {
|
|
87
|
-
_tag = "OtherPasskey";
|
|
85
|
+
_tag = "@error/OtherPasskey";
|
|
88
86
|
error;
|
|
89
87
|
message;
|
|
90
88
|
code;
|
|
@@ -98,7 +96,6 @@ export class OtherPasskeyError extends Error {
|
|
|
98
96
|
if (cause)
|
|
99
97
|
this.cause = cause;
|
|
100
98
|
}
|
|
101
|
-
static isOtherPasskeyError = isOtherPasskeyError;
|
|
102
99
|
}
|
|
103
100
|
/**
|
|
104
101
|
* Raised if excludeCredentials was provided and the device
|
|
@@ -122,13 +119,12 @@ export const isDuplicatePasskeyError = (payload) => {
|
|
|
122
119
|
* @category Passkeys (errors)
|
|
123
120
|
*/
|
|
124
121
|
export class DuplicatePasskeyError extends Error {
|
|
125
|
-
_tag = "
|
|
122
|
+
_tag = "@error/DuplicatePasskey";
|
|
126
123
|
message;
|
|
127
124
|
constructor({ message }) {
|
|
128
125
|
super();
|
|
129
126
|
this.message = message;
|
|
130
127
|
}
|
|
131
|
-
static isDuplicatePasskeyError = isDuplicatePasskeyError;
|
|
132
128
|
}
|
|
133
129
|
/**
|
|
134
130
|
* The browser/device was unable to delete the passkey
|
|
@@ -148,7 +144,7 @@ export const isDeleteError = (payload) => {
|
|
|
148
144
|
* @category Passkeys (errors)
|
|
149
145
|
*/
|
|
150
146
|
export class DeleteError extends Error {
|
|
151
|
-
_tag = "
|
|
147
|
+
_tag = "@error/Delete";
|
|
152
148
|
message;
|
|
153
149
|
code;
|
|
154
150
|
constructor({ message, code, }) {
|
|
@@ -156,7 +152,6 @@ export class DeleteError extends Error {
|
|
|
156
152
|
this.message = message;
|
|
157
153
|
this.code = code;
|
|
158
154
|
}
|
|
159
|
-
static isDeleteError = isDeleteError;
|
|
160
155
|
}
|
|
161
156
|
/* Pruning error */
|
|
162
157
|
/**
|
|
@@ -177,7 +172,7 @@ export const isPruningError = (payload) => {
|
|
|
177
172
|
* @category Passkeys (errors)
|
|
178
173
|
*/
|
|
179
174
|
export class PruningError extends Error {
|
|
180
|
-
_tag = "
|
|
175
|
+
_tag = "@error/Pruning";
|
|
181
176
|
message;
|
|
182
177
|
code;
|
|
183
178
|
constructor({ message, code, }) {
|
|
@@ -185,7 +180,6 @@ export class PruningError extends Error {
|
|
|
185
180
|
this.message = message;
|
|
186
181
|
this.code = code;
|
|
187
182
|
}
|
|
188
|
-
static isPruningError = isPruningError;
|
|
189
183
|
}
|
|
190
184
|
/**
|
|
191
185
|
* The browser/device was unable to update the local passkey
|
|
@@ -205,7 +199,7 @@ export const isUpdateError = (payload) => {
|
|
|
205
199
|
* @category Passkeys (errors)
|
|
206
200
|
*/
|
|
207
201
|
export class UpdateError extends Error {
|
|
208
|
-
_tag = "
|
|
202
|
+
_tag = "@error/Update";
|
|
209
203
|
message;
|
|
210
204
|
code;
|
|
211
205
|
constructor({ message, code, }) {
|
|
@@ -213,6 +207,5 @@ export class UpdateError extends Error {
|
|
|
213
207
|
this.message = message;
|
|
214
208
|
this.code = code;
|
|
215
209
|
}
|
|
216
|
-
static isUpdateError = isUpdateError;
|
|
217
210
|
}
|
|
218
211
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/passkey/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,OAAgB,EACoB,EAAE;IACtC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAClC,OAAO,OAAO,YAAY,uBAAuB,CAAA;AACnD,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/passkey/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,OAAgB,EACoB,EAAE;IACtC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAClC,OAAO,OAAO,YAAY,uBAAuB,CAAA;AACnD,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,IAAI,GAAG,2BAAoC,CAAA;IAC3C,OAAO,CAAQ;IAExB,YAAY,EAAE,OAAO,EAAuB;QAC1C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAgB,EACiB,EAAE;IACnC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,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;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,GAAG,gBAAyB,CAAA;IAChC,OAAO,CAAQ;IACf,IAAI,CAA+C;IAE5D,YAAY,EACV,OAAO,EACP,IAAI,GACqE;QACzE,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAA0B,EAAE;IACxE,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAClC,OAAO,OAAO,YAAY,WAAW,CAAA;AACvC,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,GAAG,eAAwB,CAAA;IAC/B,OAAO,CAAQ;IACf,IAAI,CAA8C;IAE3D,YAAY,EACV,OAAO,EACP,IAAI,GACoE;QACxE,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"}
|
|
@@ -11,6 +11,8 @@ import type { Millis, UserVerification } from "../shared";
|
|
|
11
11
|
/**
|
|
12
12
|
* Passkey registration options
|
|
13
13
|
*
|
|
14
|
+
* @see {@link registerPasskey}
|
|
15
|
+
*
|
|
14
16
|
* @category Passkeys (core)
|
|
15
17
|
*/
|
|
16
18
|
export interface RegistrationOptions extends PasslockOptions {
|
|
@@ -22,36 +24,33 @@ export interface RegistrationOptions extends PasslockOptions {
|
|
|
22
24
|
* You won't directly associate the username with an account in your
|
|
23
25
|
* backend. Instead, you'll associate the passkey ID with an account.
|
|
24
26
|
*
|
|
25
|
-
* @see {@link https://passlock.dev/passkeys/registration}
|
|
27
|
+
* @see {@link https://passlock.dev/passkeys/registration Register a passkey (main docs)}
|
|
26
28
|
*/
|
|
27
29
|
username: string;
|
|
28
30
|
/**
|
|
29
31
|
* May be shown by devices in place of the username e.g. given a username
|
|
30
32
|
* of jdoe or jdoe@gmail.com a suitable display name might be "John Doe"
|
|
31
|
-
* or "John Doe (personal)".
|
|
32
|
-
* choose to display this property.
|
|
33
|
+
* or "John Doe (personal)". **note:** There's no guarantee browsers/devices
|
|
34
|
+
* will choose to display this property.
|
|
33
35
|
*/
|
|
34
36
|
userDisplayName?: string | undefined;
|
|
35
37
|
/**
|
|
36
38
|
* Prevents the user registering a passkey if they already have one
|
|
37
39
|
* (associated with the same user account) registered on the current device.
|
|
38
40
|
*
|
|
39
|
-
* @see {@link https://passlock.dev/passkeys/exclude-credentials}
|
|
41
|
+
* @see {@link https://passlock.dev/passkeys/exclude-credentials Excluding credentials (main docs)}
|
|
40
42
|
*/
|
|
41
43
|
excludeCredentials?: Array<string> | undefined;
|
|
42
44
|
/**
|
|
43
45
|
* Whether the device should re-authenticate the user locally before registering the passkey.
|
|
44
46
|
*
|
|
45
|
-
* @see {@link https://passlock.dev/passkeys/user-verification}
|
|
47
|
+
* @see {@link https://passlock.dev/passkeys/user-verification User verification (main docs)}
|
|
46
48
|
*/
|
|
47
49
|
userVerification?: UserVerification | undefined;
|
|
48
50
|
/**
|
|
49
51
|
* Receive notifications about key stages in the registration process.
|
|
50
52
|
* For example, you might use event notifications to toggle loading icons or
|
|
51
53
|
* to disable certain form fields.
|
|
52
|
-
*
|
|
53
|
-
* @param event
|
|
54
|
-
* @returns Nothing.
|
|
55
54
|
*/
|
|
56
55
|
onEvent?: OnRegistrationEvent;
|
|
57
56
|
/**
|
|
@@ -61,12 +60,12 @@ export interface RegistrationOptions extends PasslockOptions {
|
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
63
62
|
* Represents the outcome of a successful passkey registration.
|
|
64
|
-
* Submit the code and/or id_token to your backend, then either
|
|
65
|
-
* exchange the code with the
|
|
66
|
-
* verify the id_token (JWT).
|
|
63
|
+
* Submit the `code` and/or `id_token` to your backend, then either
|
|
64
|
+
* exchange the code with the Passlock REST API or decode and
|
|
65
|
+
* verify the id_token (JWT). **note:** The @passlock/node library
|
|
66
|
+
* includes utilities for this.
|
|
67
67
|
*
|
|
68
|
-
*
|
|
69
|
-
* for you.
|
|
68
|
+
* @see {@link isRegistrationSuccess}
|
|
70
69
|
*
|
|
71
70
|
* @category Passkeys (core)
|
|
72
71
|
*/
|
|
@@ -129,13 +128,18 @@ export type RegistrationError = PasskeyUnsupportedError | DuplicatePasskeyError
|
|
|
129
128
|
* fails with {@link RegistrationError}.
|
|
130
129
|
*/
|
|
131
130
|
export declare const registerPasskey: (options: RegistrationOptions) => Micro.Micro<RegistrationSuccess, RegistrationError, Logger | RegistrationHelper>;
|
|
132
|
-
export declare const RegistrationEvent: readonly ["optionsRequest", "createCredential", "saveCredential"];
|
|
133
131
|
/**
|
|
134
132
|
* Type of the registration event
|
|
135
133
|
*
|
|
136
134
|
* @category Passkeys (other)
|
|
137
135
|
*/
|
|
138
|
-
export
|
|
136
|
+
export declare const RegistrationEvents: readonly ["optionsRequest", "createCredential", "saveCredential"];
|
|
137
|
+
/**
|
|
138
|
+
* Type of the registration event
|
|
139
|
+
*
|
|
140
|
+
* @category Passkeys (other)
|
|
141
|
+
*/
|
|
142
|
+
export type RegistrationEvent = "optionsRequest" | "createCredential" | "saveCredential";
|
|
139
143
|
/**
|
|
140
144
|
* Callback to receive registration lifecycle events.
|
|
141
145
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../../src/passkey/registration/registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAA;AACjD,OAAO,EACL,KAAK,sCAAsC,EAC3C,KAAK,wBAAwB,EAE9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAW,KAAK,EAAQ,MAAM,QAA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gCxD,CAAA;AAEJ;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,uBAAuB,GACvB,qBAAqB,GACrB,iBAAiB,GACjB,YAAY,CAAA;AAEhB;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,KAC3B,KAAK,CAAC,KAAK,CACZ,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,GAAG,kBAAkB,CAmB5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,mEAIrB,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,CAAA;AAEpB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA"}
|
|
@@ -32,9 +32,7 @@ export const isRegistrationSuccess = (payload) => {
|
|
|
32
32
|
return false;
|
|
33
33
|
if (typeof payload._tag !== "string")
|
|
34
34
|
return false;
|
|
35
|
-
|
|
36
|
-
return false;
|
|
37
|
-
return true;
|
|
35
|
+
return payload._tag === "RegistrationSuccess";
|
|
38
36
|
};
|
|
39
37
|
export const isOptionsResponse = (payload) => {
|
|
40
38
|
if (typeof payload !== "object")
|
|
@@ -146,7 +144,12 @@ export const registerPasskey = (options) => {
|
|
|
146
144
|
});
|
|
147
145
|
return pipe(effect, Micro.provideService(TenancyId, options), Micro.provideService(Endpoint, endpoint));
|
|
148
146
|
};
|
|
149
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Type of the registration event
|
|
149
|
+
*
|
|
150
|
+
* @category Passkeys (other)
|
|
151
|
+
*/
|
|
152
|
+
export const RegistrationEvents = [
|
|
150
153
|
"optionsRequest",
|
|
151
154
|
"createCredential",
|
|
152
155
|
"saveCredential",
|