print recovery code. changed vault and login route

This commit is contained in:
Kyle Spearrin 2017-02-11 14:21:21 -05:00
parent 52b89455d7
commit 7373e281ac
3 changed files with 22 additions and 15 deletions

View File

@ -76,7 +76,7 @@ angular
} }
}) })
.state('backend.vault', { .state('backend.vault', {
url: '^/', url: '^/vault',
templateUrl: 'app/vault/views/vault.html', templateUrl: 'app/vault/views/vault.html',
controller: 'vaultController', controller: 'vaultController',
data: { pageTitle: 'My Vault' } data: { pageTitle: 'My Vault' }
@ -110,14 +110,14 @@ angular
} }
}) })
.state('frontend.login.info', { .state('frontend.login.info', {
url: '^/login', url: '^/',
templateUrl: 'app/accounts/views/accountsLoginInfo.html', templateUrl: 'app/accounts/views/accountsLoginInfo.html',
data: { data: {
pageTitle: 'Log In' pageTitle: 'Log In'
} }
}) })
.state('frontend.login.twoFactor', { .state('frontend.login.twoFactor', {
url: '^/login/two-factor', url: '^/two-factor',
templateUrl: 'app/accounts/views/accountsLoginTwoFactor.html', templateUrl: 'app/accounts/views/accountsLoginTwoFactor.html',
data: { data: {
pageTitle: 'Log In (Two Factor)', pageTitle: 'Log In (Two Factor)',

View File

@ -74,6 +74,14 @@
}).$promise; }).$promise;
}; };
$scope.print = function (printContent) {
var w = window.open();
w.document.write('<div style="font-size: 18px; text-align: center;"><p>bitwarden two-step login recovery code:</p>' +
'<pre>' + printContent + '</pre>');
w.print();
w.close();
}
$scope.close = function () { $scope.close = function () {
$uibModalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };

View File

@ -58,17 +58,16 @@
</div> </div>
<div ng-show="enabled()"> <div ng-show="enabled()">
<hr /> <hr />
<h4>Recovery Code</h4> <div class="callout callout-danger">
<h4><i class="fa fa-warning"></i> Recovery Code <i class="fa fa-warning"></i></h4>
<p> <p>
The recovery code allows you to access your account in the event that you lose your authenticator app. The recovery code allows you to access your account in the event that you lose your authenticator app.
bitwarden support won't be able to assist you if you lose access to your account. We recommend you write down or bitwarden support won't be able to assist you if you lose access to your account. We recommend you write down or
print the recovery code below and keep it in a safe place. print the recovery code below and keep it in a safe place.
</p> </p>
<ul class="list-unstyled"> <p><strong>Recovery Code:</strong> <code>{{twoFactorModel.recovery}}</code></p>
<li> <button class="btn btn-default" ng-click="print(twoFactorModel.recovery)"><i class="fa fa-print"></i> Print</button>
<strong>Recovery Code:</strong> <code>{{twoFactorModel.recovery}}</code> </div>
</li>
</ul>
</div> </div>
<div class="callout callout-danger validation-errors" ng-show="updateTwoStepForm.$errors"> <div class="callout callout-danger validation-errors" ng-show="updateTwoStepForm.$errors">
<h4>Errors have occured</h4> <h4>Errors have occured</h4>
@ -77,7 +76,7 @@
</ul> </ul>
</div> </div>
<hr ng-show="enabled()" /> <hr ng-show="enabled()" />
<h4 style="margin-top: 30px;"><span ng-show="!enabled()">3. </span>Enter the resulting verification code from the app</h4> <h4 style="margin-top: 30px;"><span ng-show="enabled()">What to disable? </span><span ng-show="!enabled()">3. </span>Enter the resulting verification code from the app</h4>
<div class="form-group" show-errors> <div class="form-group" show-errors>
<label for="token" class="sr-only">Verification Code</label> <label for="token" class="sr-only">Verification Code</label>
<input type="text" id="token" name="Token" placeholder="Verification Code" ng-model="updateModel.token" class="form-control" required api-field /> <input type="text" id="token" name="Token" placeholder="Verification Code" ng-model="updateModel.token" class="form-control" required api-field />