mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
login custom fields view/edit
This commit is contained in:
@@ -30,8 +30,8 @@ function initApiService() {
|
||||
}
|
||||
|
||||
// Desktop
|
||||
//self.baseUrl = 'http://localhost:4000';
|
||||
//self.identityBaseUrl = 'http://localhost:33656';
|
||||
self.baseUrl = 'http://localhost:4000';
|
||||
self.identityBaseUrl = 'http://localhost:33656';
|
||||
|
||||
// Desktop HTTPS
|
||||
//self.baseUrl = 'https://localhost:44377';
|
||||
@@ -46,8 +46,8 @@ function initApiService() {
|
||||
//self.identityBaseUrl = 'https://preview-identity.bitwarden.com';
|
||||
|
||||
// Production
|
||||
self.baseUrl = 'https://api.bitwarden.com';
|
||||
self.identityBaseUrl = 'https://identity.bitwarden.com';
|
||||
//self.baseUrl = 'https://api.bitwarden.com';
|
||||
//self.identityBaseUrl = 'https://identity.bitwarden.com';
|
||||
};
|
||||
|
||||
// Auth APIs
|
||||
|
||||
@@ -17,6 +17,16 @@ function ConstantsService(i18nService) {
|
||||
Rsa2048_OaepSha256_HmacSha256_B64: 5,
|
||||
Rsa2048_OaepSha1_HmacSha256_B64: 6
|
||||
},
|
||||
cipherType: {
|
||||
login: 1,
|
||||
secureNote: 2,
|
||||
card: 3
|
||||
},
|
||||
fieldType: {
|
||||
text: 0,
|
||||
hidden: 1,
|
||||
boolean: 2
|
||||
},
|
||||
twoFactorProvider: {
|
||||
u2f: 4,
|
||||
yubikey: 3,
|
||||
|
||||
@@ -44,6 +44,51 @@ function initLoginService() {
|
||||
return self.cryptoService.encrypt(login.totp, orgKey);
|
||||
}).then(function (cs) {
|
||||
model.totp = cs;
|
||||
return self.encryptFields(login.fields, orgKey);
|
||||
}).then(function (fields) {
|
||||
model.fields = fields;
|
||||
return model;
|
||||
});
|
||||
};
|
||||
|
||||
LoginService.prototype.encryptFields = function (fields, key) {
|
||||
var self = this;
|
||||
if (!fields || !fields.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var encFields = [];
|
||||
return fields.reduce(function (promise, field) {
|
||||
return promise.then(function () {
|
||||
return self.encryptField(field, key);
|
||||
}).then(function (encField) {
|
||||
encFields.push(encField);
|
||||
});
|
||||
}, Q()).then(function () {
|
||||
return encFields;
|
||||
});
|
||||
};
|
||||
|
||||
LoginService.prototype.encryptField = function (field, key) {
|
||||
var self = this;
|
||||
|
||||
var model = {
|
||||
type: field.type
|
||||
};
|
||||
|
||||
return Q().then(function () {
|
||||
if (!field.name || field.name === '') {
|
||||
return null;
|
||||
}
|
||||
return self.cryptoService.encrypt(field.name, key);
|
||||
}).then(function (cs) {
|
||||
model.name = cs;
|
||||
if (!field.value || field.value === '') {
|
||||
return null;
|
||||
}
|
||||
return self.cryptoService.encrypt(field.value, key);
|
||||
}).then(function (cs) {
|
||||
model.value = cs;
|
||||
return model;
|
||||
});
|
||||
};
|
||||
@@ -533,7 +578,7 @@ function initLoginService() {
|
||||
return 0;
|
||||
};
|
||||
|
||||
function sortLoginsByLastUsed(a ,b) {
|
||||
function sortLoginsByLastUsed(a, b) {
|
||||
var aLastUsed = a.localData && a.localData.lastUsedDate ? a.localData.lastUsedDate : null;
|
||||
var bLastUsed = b.localData && b.localData.lastUsedDate ? b.localData.lastUsedDate : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user