Skip to content

Commit

Permalink
Merge pull request #1139 from near/ONB-87
Browse files Browse the repository at this point in the history
feat: added isPassKeyAvailable on biometric-ed25519 package
  • Loading branch information
andy-haynes authored May 31, 2023
2 parents fbc2395 + 4f7f890 commit fece01a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-toys-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@near-js/biometric-ed25519": minor
---

Introducing a new util function, isPassKeyAvailable on biometric-ed25519 package
5 changes: 5 additions & 0 deletions packages/biometric-ed25519/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,8 @@ export const getKeys = async (username: string): Promise<[KeyPair, KeyPair]> =>
return [firstKeyPair, secondKeyPair];
});
};

// To check if current browser supports WebAuthn
export const isPassKeyAvailable = async (): Promise<boolean> => {
return window.PublicKeyCredential?.isUserVerifyingPlatformAuthenticatorAvailable?.() || false;
};

0 comments on commit fece01a

Please sign in to comment.