Skip to content

Commit

Permalink
refactor: enforce types
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Nov 21, 2024
1 parent 7bd83b8 commit 04ca3ef
Show file tree
Hide file tree
Showing 5 changed files with 360 additions and 186 deletions.
5 changes: 3 additions & 2 deletions src/internal/accountDelegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ export async function load<chain extends Chain | undefined>(

const response = raw.response as AuthenticatorAssertionResponse
const address = Bytes.toHex(new Uint8Array(response.userHandle!))
const credentialId = raw.id

// If there are extra keys to authorize (ie. session keys), sign over them.
const authorizeKeysResult = await (async () => {
Expand All @@ -419,7 +420,7 @@ export async function load<chain extends Chain | undefined>(

const { signature, metadata } = await WebAuthnP256.sign({
challenge: payload,
credentialId: raw.id,
credentialId,
rpId,
})

Expand Down Expand Up @@ -465,7 +466,7 @@ export async function load<chain extends Chain | undefined>(
if (index === 0)
return {
expiry: 0n,
id: raw.id,
id: credentialId,
publicKey: PublicKey.from(key.publicKey),
raw,
status: 'unlocked',
Expand Down
Loading

0 comments on commit 04ca3ef

Please sign in to comment.