encrypt login with org key

This commit is contained in:
Kyle Spearrin 2017-04-24 13:58:32 -04:00
parent 0aaa8a13f5
commit 9bf77ec1c3
2 changed files with 15 additions and 7 deletions

View File

@ -46,7 +46,10 @@
data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}">
<i class="fa fa-lg fa-user"></i>
</span>
<span class="text">{{login.name}}</span>
<span class="text">
{{login.name}}
<i class="fa fa-share-alt text-muted" ng-if="login.organizationId" title="Shared"></i>
</span>
<span class="detail">{{login.username}}</span>
</a>
</div>

View File

@ -17,21 +17,26 @@ function initLoginService() {
var model = {
id: login.id,
folderId: login.folderId,
favorite: login.favorite
favorite: login.favorite,
organizationId: login.organizationId
};
return cryptoService.encrypt(login.name).then(function (cs) {
var orgKey = null;
return cryptoService.getOrgKey(login.organizationId).then(function (key) {
orgKey = key;
return cryptoService.encrypt(login.name, orgKey);
}).then(function (cs) {
model.name = cs;
return cryptoService.encrypt(login.uri);
return cryptoService.encrypt(login.uri, orgKey);
}).then(function (cs) {
model.uri = cs;
return cryptoService.encrypt(login.username);
return cryptoService.encrypt(login.username, orgKey);
}).then(function (cs) {
model.username = cs;
return cryptoService.encrypt(login.password);
return cryptoService.encrypt(login.password, orgKey);
}).then(function (cs) {
model.password = cs;
return cryptoService.encrypt(login.notes);
return cryptoService.encrypt(login.notes, orgKey);
}).then(function (cs) {
model.notes = cs;
return model;