fido-alliance / webauthn-demo

WebAuthn Workshop Demo [Completed DEMO is at completed demo-branch]
MIT License
740 stars 154 forks source link

on key generation error signal registration abandonment to the server #33

Closed lefosg closed 11 months ago

lefosg commented 1 year ago

When navigator.credentials.get() throws an error, the server clears session variables (challenge and username in the specific demo). In webauthn.authn.js (in static), line 70 we send a sendWebAuthnResponse({}) with an empty object. The server (webauthn.js file in routes) makes checks for the presence of the fields and before responding with a status error in clears session variables.

For example, the navigator.credentials.get() can throw an error when clicking 'cancel' on the box that appears to select the authenticator.