File tree Expand file tree Collapse file tree 4 files changed +22
-6
lines changed
TwoFactorAuth/view/adminhtml/web Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ define([
84
84
*/
85
85
waitForTouch : function ( ) {
86
86
this . idle ( false ) ;
87
+ if ( ! navigator . credentials ) {
88
+ this . currentStep ( 'no-webauthn' ) ;
89
+ return ;
90
+ }
87
91
navigator . credentials . get ( {
88
92
publicKey : this . authenticateData . credentialRequestOptions
89
93
} )
@@ -158,8 +162,8 @@ define([
158
162
_onCredentialError : function ( u2fError ) {
159
163
this . idle ( true ) ;
160
164
161
- if ( [ 'AbortError' , 'NS_ERROR_ABORT' , 'NotAllowedError' ] . indexOf ( u2fError . name ) === - 1 ) {
162
- error . display ( $t ( 'Unable to register your device' ) ) ;
165
+ if ( [ 'AbortError' , 'NS_ERROR_ABORT' ] . indexOf ( u2fError . name ) === - 1 ) {
166
+ error . display ( $t ( u2fError . message ) ) ;
163
167
}
164
168
}
165
169
} ) ;
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ define([
78
78
*/
79
79
waitForTouch : function ( ) {
80
80
this . idle ( false ) ;
81
+ if ( ! navigator . credentials ) {
82
+ this . currentStep ( 'no-webauthn' ) ;
83
+ return ;
84
+ }
81
85
navigator . credentials . create ( {
82
86
publicKey : this . registerData . publicKey
83
87
} )
@@ -150,8 +154,8 @@ define([
150
154
_onCredentialError : function ( u2fError ) {
151
155
this . idle ( true ) ;
152
156
153
- if ( [ 'AbortError' , 'NS_ERROR_ABORT' , 'NotAllowedError' ] . indexOf ( u2fError . name ) === - 1 ) {
154
- error . display ( $t ( 'Unable to register your device' ) ) ;
157
+ if ( [ 'AbortError' , 'NS_ERROR_ABORT' ] . indexOf ( u2fError . name ) === - 1 ) {
158
+ error . display ( $t ( u2fError . message ) ) ;
155
159
}
156
160
}
157
161
} ) ;
Original file line number Diff line number Diff line change 9
9
< fieldset class ="admin__fieldset ">
10
10
< legend class ="admin__legend ">
11
11
< span translate ="'2FA - U2F key verification' "> </ span >
12
- </ legend > < br / >
12
+ </ legend > < br >
13
13
< div class ="tfa-u2f-touch-key ">
14
14
< h3 translate ="'Plug in your U2F key and follow instructions' "> </ h3 >
15
15
< div visible ="$data.idle " class ="tfa-u2f-try-again ">
@@ -27,6 +27,10 @@ <h3 translate="'Plug in your U2F key and follow instructions'"></h3>
27
27
</ div >
28
28
< div translate ="'Redirecting to Magento Admin Panel...' "> </ div >
29
29
</ 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 >
30
34
< div visible ='$data.loading ' class ="tfa-waitbox ">
31
35
< div data-role ="spinner ">
32
36
< div class ="spinner ">
Original file line number Diff line number Diff line change 9
9
< fieldset class ="admin__fieldset ">
10
10
< legend class ="admin__legend ">
11
11
< span translate ="'2FA - U2F key device registration' "> </ span >
12
- </ legend > < br / >
12
+ </ legend > < br >
13
13
< div id ="u2f-touch-key ">
14
14
< h3 translate ="'Plug in your U2F key and follow instructions' "> </ h3 >
15
15
< div visible ="$data.idle " class ="tfa-u2f-try-again ">
@@ -27,6 +27,10 @@ <h3 translate="'Plug in your U2F key and follow instructions'"></h3>
27
27
</ div >
28
28
< div translate ="'Redirecting to Magento Admin Panel...' "> </ div >
29
29
</ 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 >
30
34
< div visible ='$data.loading ' class ="tfa-waitbox ">
31
35
< div data-role ="spinner ">
32
36
< div class ="spinner ">
You can’t perform that action at this time.
0 commit comments