diff --git a/www/window/AddWebauthn.js b/www/window/AddWebauthn.js index f6d1df61..b89a9aa2 100644 --- a/www/window/AddWebauthn.js +++ b/www/window/AddWebauthn.js @@ -99,20 +99,12 @@ Ext.define('PBS.window.AddWebauthn', { try { token_response = await navigator.credentials.create(challenge_obj); } catch (error) { - let errmsg = ` - ${error.name}: ${error.message}`; + let errmsg = error.message; if (error.name === 'InvalidStateError') { - // probably a duplicate token - throw `${gettext('There was an error during authenticator registration.')} -
- ${gettext('This probably means that this authenticator is already registered.')} -

- ${errmsg}`; - } else { - throw `${gettext('There was an error during token registration.')} -

- ${errmsg}`; + errmsg = gettext('Is this token already registered?'); } + throw gettext('An error occurred during token registration.') + + `
${error.name}: ${errmsg}`; } // We cannot pass ArrayBuffers to the API, so extract & convert the data.