From 7a19d444f1b24b268d784a268e1d05e42d20373c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 24 Jun 2017 11:26:24 -0400 Subject: [PATCH] update 2fa setup pages --- .../settings/settingsTwoStepU2fController.js | 23 ++++++++--- .../settings/views/settingsTwoStepDuo.html | 2 +- .../settings/views/settingsTwoStepU2f.html | 41 ++++++++++--------- .../settings/views/settingsTwoStepYubi.html | 4 +- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/src/app/settings/settingsTwoStepU2fController.js b/src/app/settings/settingsTwoStepU2fController.js index d9bf2687b5..89467ea25d 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 82fc6a6ac4..6b1691c7eb 100644 --- a/src/app/settings/views/settingsTwoStepDuo.html +++ b/src/app/settings/views/settingsTwoStepDuo.html @@ -48,7 +48,7 @@
  • {{e}}
  • -

    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:

    {{e}}
    -

    Setting up two-step login with a FIDO U2F security key is easy, just follow these steps:

    -

    1. Plug your security key into your USB port

    -

    2. Touch the button on the security key

    -

    - -

    -
    - Waiting for you to touch the button on your security key... -
    -
    - - Got it! Click the "Enable" button below to enable this security key for two-step login. -
    -
    - There was a problem reading the security key. Try again. +

    To add a new FIDO U2F Security Key to your account:

    +
      +
    1. Plug the security key into your computer's USB port.
    2. +
    3. If the security key has a button, touch it.
    4. +
    +
    +
    +
    +

    +

    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.

    + +
    diff --git a/src/app/settings/views/settingsTwoStepYubi.html b/src/app/settings/views/settingsTwoStepYubi.html index f63a46168b..9e3e2740ae 100644 --- a/src/app/settings/views/settingsTwoStepYubi.html +++ b/src/app/settings/views/settingsTwoStepYubi.html @@ -44,10 +44,10 @@

    To add a new YubiKey to your account:

      -
    1. Plug the YubiKey into your USB port.
    2. +
    3. Plug the YubiKey (NEO or 4 series) into your computer's USB port.
    4. Select in the first empty Key field below.
    5. Touch the YubiKey's button.
    6. -
    7. Finally, save the form.
    8. +
    9. Save the form.