Skip to content

Commit 7211dc9

Browse files
committed
AC-9437: 2FA U2F screens need error handling when not available
Changed error handling to show the raw WebAuthn message because the browser does not provide a consistent mechanism to differentiate between NotAllowError types. These errors can range from auth timeout to TLS errors or even just user declining the browser prompts.
1 parent 3475425 commit 7211dc9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

TwoFactorAuth/view/adminhtml/web/js/u2fkey/auth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ define([
162162
_onCredentialError: function (u2fError) {
163163
this.idle(true);
164164

165-
if (['AbortError', 'NS_ERROR_ABORT', 'NotAllowedError'].indexOf(u2fError.name) === -1) {
166-
error.display($t('Unable to register your device'));
165+
if (['AbortError', 'NS_ERROR_ABORT'].indexOf(u2fError.name) === -1) {
166+
error.display($t(u2fError.message));
167167
}
168168
}
169169
});

TwoFactorAuth/view/adminhtml/web/js/u2fkey/configure.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ define([
154154
_onCredentialError: function (u2fError) {
155155
this.idle(true);
156156

157-
if (['AbortError', 'NS_ERROR_ABORT', 'NotAllowedError'].indexOf(u2fError.name) === -1) {
158-
error.display($t('Unable to register your device'));
157+
if (['AbortError', 'NS_ERROR_ABORT'].indexOf(u2fError.name) === -1) {
158+
error.display($t(u2fError.message));
159159
}
160160
}
161161
});

0 commit comments

Comments
 (0)