update 2fa setup pages

This commit is contained in:
Kyle Spearrin 2017-06-24 11:26:24 -04:00
parent 73eb743f54
commit 7a19d444f1
4 changed files with 42 additions and 28 deletions

View File

@ -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;
});
});

View File

@ -48,7 +48,7 @@
<li ng-repeat="e in submitTwoStepForm.$errors">{{e}}</li>
</ul>
</div>
<p>Setting up two-step login with Duo is easy, just enter the Duo application information below:</p>
<p>Enter the bitwarden application information from your Duo Admin panel:</p>
<div class="form-group" show-errors>
<label for="ikey">Integration Key</label>
<input type="text" id="ikey" name="IntegrationKey" ng-model="updateModel.ikey" class="form-control"

View File

@ -43,25 +43,28 @@
<li ng-repeat="e in submitTwoStepForm.$errors">{{e}}</li>
</ul>
</div>
<p>Setting up two-step login with a FIDO U2F security key is easy, just follow these steps:</p>
<h4>1. Plug your security key into your USB port</h4>
<h4 style="margin-top: 30px;">2. Touch the button on the security key</h4>
<p>
<button type="button" ng-click="readDevice()" class="btn btn-default btn-flat">
<i class="fa fa-spin fa-refresh fa-fw" ng-show="deviceListening"></i>
<i class="fa fa-wifi fa-fw" ng-show="!deviceListening"></i>
Read Security Key
</button>
</p>
<p>To add a new FIDO U2F Security Key to your account:</p>
<ol>
<li>Plug the security key into your computer's USB port.</li>
<li>If the security key has a button, touch it.</li>
</ol>
<hr />
<div class="text-center">
<div ng-show="deviceListening">
Waiting for you to touch the button on your security key...
<p><i class="fa fa-spin fa-spinner fa-2x"></i></p>
<p>Waiting for you to touch the button on your security key...</p>
</div>
<div class="text-green" ng-show="deviceResponse">
<i class="fa fa-check"></i>
Got it! Click the "Enable" button below to enable this security key for two-step login.
<p><i class="fa fa-check-circle fa-2x"></i></p>
<p>Success!</p>
Click the "Enable" button below to enable this security key for two-step login.
</div>
<div class="text-red" ng-show="deviceError">
There was a problem reading the security key. Try again.
<p><i class="fa fa-warning fa-2x"></i></p>
<p>Error!</p>
<p>There was a problem reading the security key.</p>
<button type="button" class="btn btn-default btn-flat" ng-click="readDevice()">Try again</button>
</div>
</div>
</div>
</div>

View File

@ -44,10 +44,10 @@
</div>
<p>To add a new YubiKey to your account:</p>
<ol>
<li>Plug the YubiKey into your USB port.</li>
<li>Plug the YubiKey (NEO or 4 series) into your computer's USB port.</li>
<li>Select in the first empty <b>Key</b> field below.</li>
<li>Touch the YubiKey's button.</li>
<li>Finally, save the form.</li>
<li>Save the form.</li>
</ol>
<hr />
<div class="form-group" show-errors>