local mask function since encoding issue on jslib

This commit is contained in:
Kyle Spearrin 2018-03-13 08:56:24 -04:00
parent bce1fba6d2
commit 770f71d75d
2 changed files with 7 additions and 3 deletions

View File

@ -21,7 +21,7 @@ angular
cipherObj = cipher; cipherObj = cipher;
return cipher.decrypt(); return cipher.decrypt();
}).then(function (model) { }).then(function (model) {
$timeout(function() { $timeout(function () {
$scope.cipher = model; $scope.cipher = model;
if (model.login && model.login.totp && (cipherObj.organizationUseTotp || tokenService.getPremium())) { if (model.login && model.login.totp && (cipherObj.organizationUseTotp || tokenService.getPremium())) {
totpUpdateCode(); totpUpdateCode();
@ -159,6 +159,10 @@ angular
return year; return year;
}; };
$scope.maskValue = function (value) {
return value ? '••••••••' : null;
};
function totpUpdateCode() { function totpUpdateCode() {
if ($scope.cipher.type !== constantsService.cipherType.login || !$scope.cipher.login.totp) { if ($scope.cipher.type !== constantsService.cipherType.login || !$scope.cipher.login.totp) {
return; return;

View File

@ -45,7 +45,7 @@
</a> </a>
</div> </div>
<span class="item-label">{{i18n.password}}</span> <span class="item-label">{{i18n.password}}</span>
<span ng-show="!showPassword" class="monospaced">{{cipher.login.maskedPassword}}</span> <span ng-show="!showPassword" class="monospaced">{{maskValue(cipher.login.password)}}</span>
<span id="password" ng-show="showPassword" class="monospaced">{{cipher.login.password}}</span> <span id="password" ng-show="showPassword" class="monospaced">{{cipher.login.password}}</span>
</div> </div>
<div class="list-section-item totp" ng-class="{'low': totpLow}" ng-if="cipher.login.totp && totpCode"> <div class="list-section-item totp" ng-class="{'low': totpLow}" ng-if="cipher.login.totp && totpCode">
@ -219,7 +219,7 @@
{{field.value || '&nbsp;'}} {{field.value || '&nbsp;'}}
</div> </div>
<div ng-if="field.type === constants.fieldType.hidden"> <div ng-if="field.type === constants.fieldType.hidden">
<span ng-show="!field.showValue" class="monospaced">{{field.maskedValue}}</span> <span ng-show="!field.showValue" class="monospaced">{{maskValue(field.value)}}</span>
<span ng-show="field.showValue" class="monospaced">{{field.value}}</span> <span ng-show="field.showValue" class="monospaced">{{field.value}}</span>
</div> </div>
<div ng-if="field.type === constants.fieldType.boolean"> <div ng-if="field.type === constants.fieldType.boolean">