diff options
Diffstat (limited to 'src/passkey.js')
| -rw-r--r-- | src/passkey.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/passkey.js b/src/passkey.js index 248e1e6..7d5e6e5 100644 --- a/src/passkey.js +++ b/src/passkey.js @@ -54,14 +54,16 @@ export async function passkeySignIn() { // Create a passkey, then derive the key from it. Some platforms evaluate PRF // during creation; the rest need a follow-up assertion against the new // credential — both paths end at the same bytes. -export async function passkeyCreate() { +// `name` labels the credential in the platform's passkey picker (a way back +// into a named account reads "[email protected]", not just "coinos"). +export async function passkeyCreate({ name = 'coinos', displayName = 'Coinos wallet' } = {}) { const cred = await navigator.credentials.create({ publicKey: { challenge: crypto.getRandomValues(new Uint8Array(32)), rp: { name: 'Coinos', id: location.hostname }, user: { id: crypto.getRandomValues(new Uint8Array(16)), - name: 'coinos', displayName: 'Coinos wallet', + name, displayName, }, pubKeyCredParams: [{ type: 'public-key', alg: -7 }, { type: 'public-key', alg: -257 }], authenticatorSelection: { residentKey: 'required', userVerification: 'required' }, |
