mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
decrypt and list sites
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var FolderData = function (response, userId) {
|
||||
var FolderData = function (response, userId) {
|
||||
var data = null;
|
||||
if (response instanceof FolderResponse) {
|
||||
data = response;
|
||||
@@ -10,10 +10,10 @@
|
||||
throw 'unsupported instance';
|
||||
}
|
||||
|
||||
this.id = response.Id;
|
||||
this.id = response.id;
|
||||
this.userId = userId;
|
||||
this.name = data.Name;
|
||||
this.revisionDate = response.RevisionDate;
|
||||
this.name = data.name;
|
||||
this.revisionDate = response.revisionDate;
|
||||
};
|
||||
|
||||
var SiteData = function (response, userId) {
|
||||
@@ -28,14 +28,14 @@ var SiteData = function (response, userId) {
|
||||
throw 'unsupported instance';
|
||||
}
|
||||
|
||||
this.id = response.Id;
|
||||
this.folderId = response.FolderId;
|
||||
this.id = response.id;
|
||||
this.folderId = response.folderId;
|
||||
this.userId = userId;
|
||||
this.name = data.Name;
|
||||
this.uri = data.Uri;
|
||||
this.username = data.Username;
|
||||
this.password = data.Password;
|
||||
this.notes = data.Notes;
|
||||
this.favorite = response.Favorite;
|
||||
this.revisionDate = response.RevisionDate;
|
||||
this.name = data.name;
|
||||
this.uri = data.uri;
|
||||
this.username = data.username;
|
||||
this.password = data.password;
|
||||
this.notes = data.notes;
|
||||
this.favorite = response.favorite;
|
||||
this.revisionDate = response.revisionDate;
|
||||
};
|
||||
|
||||
@@ -18,40 +18,41 @@ var CipherString = function (encryptedString) {
|
||||
callback(_decryptedValue);
|
||||
});
|
||||
}
|
||||
|
||||
callback(_decryptedValue);
|
||||
else {
|
||||
callback(_decryptedValue);
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
var Site = function (obj, alreadyEncrypted) {
|
||||
this.id = obj.id;
|
||||
this.folderId = obj.folderId;
|
||||
this.id = obj.id ? obj.id : null;
|
||||
this.folderId = obj.folderId ? obj.folderId : null;
|
||||
|
||||
if (alreadyEncrypted === true) {
|
||||
this.name = obj.name;
|
||||
this.uri = obj.uri;
|
||||
this.username = obj.username;
|
||||
this.password = obj.password;
|
||||
this.notes = obj.notes;
|
||||
this.name = obj.name ? obj.name : null;
|
||||
this.uri = obj.uri ? obj.uri : null;
|
||||
this.username = obj.username ? obj.username : null;
|
||||
this.password = obj.password ? obj.password : null;
|
||||
this.notes = obj.notes ? obj.notes : null;
|
||||
}
|
||||
else {
|
||||
this.name = new CipherString(obj.name);
|
||||
this.uri = new CipherString(obj.uri);
|
||||
this.username = new CipherString(obj.username);
|
||||
this.password = new CipherString(obj.password);
|
||||
this.notes = new CipherString(obj.notes);
|
||||
this.name = obj.name ? new CipherString(obj.name) : null;
|
||||
this.uri = obj.uri ? new CipherString(obj.uri) : null;
|
||||
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.favorite = obj.favorite ? true : false;
|
||||
};
|
||||
|
||||
var Folder = function (obj, alreadyEncrypted) {
|
||||
this.id = obj.id;
|
||||
this.id = obj.id ? obj.id : null;
|
||||
|
||||
if (alreadyEncrypted === true) {
|
||||
this.name = obj.name;
|
||||
this.name = obj.name ? obj.name : null;
|
||||
}
|
||||
else {
|
||||
this.name = new CipherString(obj.name);
|
||||
this.name = obj.name ? new CipherString(obj.name) : null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user