-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import twaLogo from './assets/tapps.png' | ||
import viteLogo from '/vite.svg' | ||
|
@@ -16,7 +15,6 @@ function App() { | |
|
||
const cartridgeConnector = connectors[0] | ||
|
||
const [credentials, setCredentials] = useState<Credential | null>(null) | ||
const biometryManager = useBiometryManager() | ||
|
||
return ( | ||
|
@@ -53,34 +51,6 @@ function App() { | |
}}> | ||
gib data | ||
</button> | ||
<button onClick={async () => { | ||
const publicKeyCredentialCreationOptions = { | ||
challenge: new Uint8Array(32), // You should generate this on your server | ||
rp: { | ||
name: "Beast Slayers", | ||
id: "beast-slayers.vercel.app", | ||
}, | ||
user: { | ||
id: new Uint8Array(16), // You should generate a unique user ID | ||
name: "[email protected]", | ||
displayName: "User Name", | ||
}, | ||
pubKeyCredParams: [{ alg: -7, type: "public-key" }], | ||
authenticatorSelection: { | ||
authenticatorAttachment: "platform", | ||
}, | ||
timeout: 60000, | ||
} as PublicKeyCredentialCreationOptions; | ||
|
||
// Create credentials | ||
const credentials = await navigator.credentials.create({ | ||
publicKey: publicKeyCredentialCreationOptions | ||
}) | ||
|
||
setCredentials(credentials) | ||
}}> | ||
{credentials ? JSON.stringify(credentials) : 'create'} | ||
</button> | ||
<div className="card"> | ||
<button onClick={() => biometryManager?.openSettings()}> | ||
Bio settings | ||
|