You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Rework auth flow
* Expose id from PassKey class
* Testing every permutation of methods and sequences
* Re-order methods
* Remove unused timeouts
* Remove redundant method vs type
* Introduce consts for passkey and passphrase
* Document failure case
* Comments and error handling
// A `PassKey` represents an authentication via a WebAuthn authenticator.
@@ -31,13 +32,20 @@ export class PassKey {
31
32
this.credentials=credentials;
32
33
}
33
34
35
+
id(){
36
+
returnthis.credentials.id;
37
+
}
38
+
34
39
// Generate a root key from a `PassKey`.
35
40
// A root key identity is deterministically derived from a `PassKey`'s
36
41
// PRF output, a 32-byte hash, which is used as ed25519 key material.
42
+
// Note: Root keys can only be created from PassKeys obtained via PassKey.get()
37
43
asynccreateRootKey(): Promise<Identity>{
38
44
letseed=this.prf();
39
45
if(!seed){
40
-
thrownewError("common-identity: No prf found from PassKey");
46
+
thrownewError(
47
+
"common-identity: No PRF found. This PassKey appears to have just been created - root keys can only be generated from PassKeys obtained via PassKey.get()",
48
+
);
41
49
}
42
50
43
51
returnawaitIdentity.fromRaw(seed);
@@ -66,15 +74,15 @@ export class PassKey {
66
74
// Different data is available within `PublicKeyCredentials` depending
67
75
// on whether it was created or retrieved. We need the PRF assertion
68
76
// only available on "get" requests, so we don't return a `PassKey` here.
0 commit comments