File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
src/frontend/src/lib/utils Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ export const authenticateWithPasskey = async ({
56
56
return CosePublicKey . fromDer ( new Uint8Array ( lookupResult . pubkey ) ) ;
57
57
} ,
58
58
} ) ;
59
+ if ( features . DUMMY_AUTH ) {
60
+ identityNumber = ( await actor . lookup_device_key ( new Uint8Array ( 32 ) ) ) [ 0 ] !
61
+ . anchor_number ;
62
+ }
59
63
const delegation = await DelegationChain . create (
60
64
passkeyIdentity ,
61
65
session . identity . getPublicKey ( ) ,
Original file line number Diff line number Diff line change 1
- import { type Signature } from "@dfinity/agent" ;
1
+ import { PublicKey , type Signature } from "@dfinity/agent" ;
2
2
import { Ed25519KeyIdentity } from "@dfinity/identity" ;
3
3
import {
4
4
CosePublicKey ,
@@ -12,8 +12,8 @@ export class DiscoverableDummyIdentity extends DiscoverablePasskeyIdentity {
12
12
super ( ) ;
13
13
}
14
14
15
- getPublicKey ( ) : CosePublicKey {
16
- return CosePublicKey . fromDer ( dummyIdentity . getPublicKey ( ) . toDer ( ) ) ;
15
+ getPublicKey ( ) : PublicKey {
16
+ return dummyIdentity . getPublicKey ( ) ;
17
17
}
18
18
19
19
getCredentialId ( ) : ArrayBuffer | undefined {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ function coseToDerEncodedBlob(cose: ArrayBuffer): DerEncodedPublicKey {
38
38
}
39
39
40
40
function coseFromDerEncodedBlob ( derEncoded : DerEncodedPublicKey ) : ArrayBuffer {
41
+ console . log ( "derEncoded" , derEncoded ) ;
41
42
return unwrapDER ( derEncoded , DER_COSE_OID ) . buffer as ArrayBuffer ;
42
43
}
43
44
@@ -197,7 +198,7 @@ export class DiscoverablePasskeyIdentity extends SignIdentity {
197
198
} ) ;
198
199
}
199
200
200
- getPublicKey ( ) : CosePublicKey {
201
+ getPublicKey ( ) : PublicKey {
201
202
if ( ! this . #publicKey) {
202
203
throw Error ( "Sign first to retrieve public key" ) ;
203
204
}
You can’t perform that action at this time.
0 commit comments