1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +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

@@ -5,6 +5,7 @@ import { CardData } from './cardData';
import { FieldData } from './fieldData';
import { IdentityData } from './identityData';
import { LoginData } from './loginData';
import { PasswordHistoryData } from './passwordHistoryData';
import { SecureNoteData } from './secureNoteData';
import { CipherResponse } from '../response/cipherResponse';
@@ -28,6 +29,7 @@ export class CipherData {
identity?: IdentityData;
fields?: FieldData[];
attachments?: AttachmentData[];
passwordHistory?: PasswordHistoryData[];
collectionIds?: string[];
constructor(response?: CipherResponse, userId?: string, collectionIds?: string[]) {
@@ -83,5 +85,12 @@ export class CipherData {
this.attachments.push(new AttachmentData(attachment));
});
}
if (response.passwordHistory != null) {
this.passwordHistory = [];
response.passwordHistory.forEach((ph) => {
this.passwordHistory.push(new PasswordHistoryData(ph));
});
}
}
}

View File

@@ -0,0 +1,15 @@
import { PasswordHistoryResponse } from '../response/passwordHistoryResponse';
export class PasswordHistoryData {
password: string;
lastUsedDate: Date;
constructor(response?: PasswordHistoryResponse) {
if (response == null) {
return;
}
this.password = response.password;
this.lastUsedDate = response.lastUsedDate;
}
}