Skip to content

Commit

Permalink
fix: hsm account creation regression (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency authored Oct 12, 2023
1 parent 37d09c7 commit de373d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
25 changes: 15 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/features/accounts/api/save-webauthn-credential.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useMutation } from "react-query"
import { useNetworkContext } from "features/network"
import { WebAuthnIdentity } from "@liftedinit/many-js"
import { IdStore, Network, WebAuthnIdentity } from "@liftedinit/many-js"

export function useSaveWebauthnCredential() {
const { command: n } = useNetworkContext()
const { command } = useNetworkContext()
return useMutation<
{ phrase: string },
Error,
Expand All @@ -13,7 +13,10 @@ export function useSaveWebauthnCredential() {
cosePublicKey: ArrayBuffer
identity: WebAuthnIdentity
}
>(async ({ address, credentialId, cosePublicKey }) => {
>(async ({ address, credentialId, cosePublicKey, identity }) => {
// This is required because at this point the Webauthn identity is not yet stored in the store.
const n = new Network(command?.url ?? "", identity)
n.apply([IdStore])
return await n?.idStore.store(address, credentialId, cosePublicKey)
})
}

0 comments on commit de373d2

Please sign in to comment.