Skip to content

Commit aebe930

Browse files
committed
AC-9437: 2FA U2F screens need error handling when not available
1 parent 506c339 commit aebe930

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ define([
8484
*/
8585
waitForTouch: function () {
8686
this.idle(false);
87+
if (!navigator.credentials) {
88+
this.currentStep("no-webauthn");
89+
return;
90+
}
8791
navigator.credentials.get({
8892
publicKey: this.authenticateData.credentialRequestOptions
8993
})

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ define([
7878
*/
7979
waitForTouch: function () {
8080
this.idle(false);
81+
if (!navigator.credentials) {
82+
this.currentStep("no-webauthn");
83+
return;
84+
}
8185
navigator.credentials.create({
8286
publicKey: this.registerData.publicKey
8387
})

TwoFactorAuth/view/adminhtml/web/template/u2fkey/auth.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ <h3 translate="'Plug in your U2F key and follow instructions'"></h3>
2727
</div>
2828
<div translate="'Redirecting to Magento Admin Panel...'"></div>
2929
</div>
30+
<div visible='currentStep() === "no-webauthn"'
31+
translate="'Error! Your browser does not support WebAuthn or you are not using a secure connection'"
32+
>
33+
</div>
3034
<div visible='$data.loading' class="tfa-waitbox">
3135
<div data-role="spinner">
3236
<div class="spinner">

TwoFactorAuth/view/adminhtml/web/template/u2fkey/configure.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ <h3 translate="'Plug in your U2F key and follow instructions'"></h3>
2727
</div>
2828
<div translate="'Redirecting to Magento Admin Panel...'"></div>
2929
</div>
30+
<div visible='currentStep() === "no-webauthn"'
31+
translate="'Error! Your browser does not support WebAuthn or you are not using a secure connection'"
32+
>
33+
</div>
3034
<div visible='$data.loading' class="tfa-waitbox">
3135
<div data-role="spinner">
3236
<div class="spinner">

0 commit comments

Comments
 (0)