1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

model adjustments for new api props

This commit is contained in:
Kyle Spearrin
2017-07-11 13:00:47 -04:00
parent ba6e0d9617
commit c92b346e18
4 changed files with 47 additions and 2 deletions

View File

@@ -100,6 +100,7 @@ var Login = function (obj, alreadyEncrypted) {
this.username = obj.username ? obj.username : null;
this.password = obj.password ? obj.password : null;
this.notes = obj.notes ? obj.notes : null;
this.totp = obj.totp ? obj.totp : null;
}
else {
this.name = obj.name ? new CipherString(obj.name) : null;
@@ -107,6 +108,7 @@ var Login = function (obj, alreadyEncrypted) {
this.username = obj.username ? new CipherString(obj.username) : null;
this.password = obj.password ? new CipherString(obj.password) : null;
this.notes = obj.notes ? new CipherString(obj.notes) : null;
this.totp = obj.totp ? new CipherString(obj.totp) : null;
}
};
@@ -183,6 +185,12 @@ var Folder = function (obj, alreadyEncrypted) {
return null;
}).then(function (val) {
model.notes = val;
if (self.totp) {
return self.totp.decrypt(self.organizationId);
}
return null;
}).then(function (val) {
model.totp = val;
deferred.resolve(model);
});