diff --git a/src/app/settings/settingsTwoStepU2fController.js b/src/app/settings/settingsTwoStepU2fController.js index d9bf2687b5e..89467ea25d7 100644 --- a/src/app/settings/settingsTwoStepU2fController.js +++ b/src/app/settings/settingsTwoStepU2fController.js @@ -5,6 +5,7 @@ authService, toastr, $analytics, constants, $timeout, $window) { $analytics.eventTrack('settingsTwoStepU2fController', { category: 'Modal' }); var _masterPasswordHash; + var closed = false; $scope.deviceResponse = null; $scope.deviceListening = false; @@ -24,6 +25,12 @@ }; $scope.readDevice = function () { + if (closed) { + return; + } + + console.log('listening for key...'); + $scope.deviceResponse = null; $scope.deviceError = false; $scope.deviceListening = true; @@ -33,11 +40,11 @@ challenge: $scope.challenge.Challenge }], [], function (data) { $scope.deviceListening = false; - - console.log('call back data:'); - console.log(data); - - if (data.errorCode) { + if (data.errorCode === 5) { + $scope.readDevice(); + return; + } + else if (data.errorCode) { $scope.deviceError = true; $scope.$apply(); console.log('error: ' + data.errorCode); @@ -46,7 +53,7 @@ $scope.deviceResponse = JSON.stringify(data); $scope.$apply(); - }); + }, 5); }; $scope.submit = function () { @@ -90,4 +97,8 @@ $scope.close = function () { $uibModalInstance.close($scope.enabled); }; + + $scope.$on('modal.closing', function (event) { + closed = true; + }); }); diff --git a/src/app/settings/views/settingsTwoStepDuo.html b/src/app/settings/views/settingsTwoStepDuo.html index 82fc6a6ac42..6b1691c7ebe 100644 --- a/src/app/settings/views/settingsTwoStepDuo.html +++ b/src/app/settings/views/settingsTwoStepDuo.html @@ -48,7 +48,7 @@
Setting up two-step login with Duo is easy, just enter the Duo application information below:
+Enter the bitwarden application information from your Duo Admin panel:
Setting up two-step login with a FIDO U2F security key is easy, just follow these steps:
-- -
-To add a new FIDO U2F Security Key to your account:
++
Waiting for you to touch the button on your security key...
++
Success!
+ Click the "Enable" button below to enable this security key for two-step login. ++
Error!
+There was a problem reading the security key.
+ +To add a new YubiKey to your account: