1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

send password history to server

This commit is contained in:
Kyle Spearrin
2018-07-27 16:44:20 -04:00
parent 9df96a3288
commit dab9954887
16 changed files with 243 additions and 18 deletions

View File

@@ -8,6 +8,8 @@ import { IdentityApi } from '../api/identityApi';
import { LoginApi } from '../api/loginApi';
import { SecureNoteApi } from '../api/secureNoteApi';
import { PasswordHistoryRequest } from './passwordHistoryRequest';
export class CipherRequest {
type: CipherType;
folderId: string;
@@ -20,6 +22,7 @@ export class CipherRequest {
card: CardApi;
identity: IdentityApi;
fields: FieldApi[];
passwordHistory: PasswordHistoryRequest[];
attachments: { [id: string]: string; };
constructor(cipher: Cipher) {
@@ -102,6 +105,16 @@ export class CipherRequest {
});
}
if (cipher.passwordHistory) {
this.passwordHistory = [];
cipher.passwordHistory.forEach((ph) => {
this.passwordHistory.push({
lastUsedDate: ph.lastUsedDate,
password: ph.password ? ph.password.encryptedString : null,
});
});
}
if (cipher.attachments) {
this.attachments = {};
cipher.attachments.forEach((attachment) => {