1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-29 17:38:04 +01:00

add field for totp to login

This commit is contained in:
Kyle Spearrin 2017-07-06 21:22:06 -04:00
parent dfd791ecf9
commit 8a90f562ef
4 changed files with 36 additions and 8 deletions

View File

@ -3,14 +3,15 @@ angular
.directive('passwordMeter', function () {
return {
template: '<div class="progress {{outerClass}}"><div class="progress-bar progress-bar-{{valueClass}}" ' +
template: '<div class="progress {{outerClass}}" style="{{outerStyle}}"><div class="progress-bar progress-bar-{{valueClass}}" ' +
'role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" ' +
'ng-style="{width : ( value + \'%\' ) }"><span class="sr-only">{{value}}%</span></div></div>',
restrict: 'A',
scope: {
password: '=passwordMeter',
username: '=passwordMeterUsername',
outerClass: '@?'
outerClass: '@?',
outerStyle: '@?'
},
link: function (scope) {
var measureStrength = function (username, password) {

View File

@ -36,6 +36,7 @@ angular
username: encryptedLogin.Username && encryptedLogin.Username !== '' ? cryptoService.decrypt(encryptedLogin.Username, key) : null,
password: encryptedLogin.Password && encryptedLogin.Password !== '' ? cryptoService.decrypt(encryptedLogin.Password, key) : null,
notes: encryptedLogin.Notes && encryptedLogin.Notes !== '' ? cryptoService.decrypt(encryptedLogin.Notes, key) : null,
totp: encryptedLogin.Totp && encryptedLogin.Totp !== '' ? cryptoService.decrypt(encryptedLogin.Totp, key) : null,
attachments: null
};
@ -183,7 +184,8 @@ angular
name: cryptoService.encrypt(unencryptedLogin.name, key),
username: !unencryptedLogin.username || unencryptedLogin.username === '' ? null : cryptoService.encrypt(unencryptedLogin.username, key),
password: !unencryptedLogin.password || unencryptedLogin.password === '' ? null : cryptoService.encrypt(unencryptedLogin.password, key),
notes: !unencryptedLogin.notes || unencryptedLogin.notes === '' ? null : cryptoService.encrypt(unencryptedLogin.notes, key)
notes: !unencryptedLogin.notes || unencryptedLogin.notes === '' ? null : cryptoService.encrypt(unencryptedLogin.notes, key),
totp: !unencryptedLogin.totp || unencryptedLogin.totp === '' ? null : cryptoService.encrypt(unencryptedLogin.totp, key)
};
};

View File

@ -56,7 +56,7 @@
</div>
</div>
<div class="col-md-6">
<div class="form-group" show-errors>
<div class="form-group" show-errors style="margin-bottom: 5px;">
<div class="pull-right password-options">
<i class="fa fa-lg fa-refresh" uib-tooltip="Generate Password" tooltip-placement="left" ng-click="generatePassword()"></i>
<i class="fa fa-lg fa-eye" uib-tooltip="Toggle Password" tooltip-placement="left" password-viewer="#password"></i>
@ -75,7 +75,20 @@
</span>
</div>
</div>
<div style="margin: -10px 0 15px 0;" password-meter="login.password" password-meter-username="login.username" outer-class="xs"></div>
<div password-meter="login.password" password-meter-username="login.username"
outer-class="xs" outer-style="margin: 0;"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" show-errors>
<label for="totp">Authenticator Key (TOTP)</label>
<input type="text" id="totp" name="Totp" ng-model="login.totp" class="form-control"
ng-readonly="readOnly" api-field />
</div>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group" show-errors>

View File

@ -67,7 +67,7 @@
</div>
</div>
<div class="col-md-6">
<div class="form-group" show-errors>
<div class="form-group" show-errors style="margin-bottom: 5px;">
<div class="pull-right password-options">
<i class="fa fa-lg fa-refresh" uib-tooltip="Generate Password" tooltip-placement="left"
ng-click="generatePassword()" ng-show="!readOnly"></i>
@ -87,8 +87,20 @@
</span>
</div>
</div>
<div style="margin: -10px 0 15px 0;" password-meter="login.password" password-meter-username="login.username"
outer-class="xs"></div>
<div password-meter="login.password" password-meter-username="login.username"
outer-class="xs" outer-style="margin: 0;"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" show-errors>
<label for="totp">Authenticator Key (TOTP)</label>
<input type="text" id="totp" name="Totp" ng-model="login.totp" class="form-control"
ng-readonly="readOnly" api-field />
</div>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group" show-errors>