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:
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
src/models/data/passwordHistoryData.ts
Normal file
15
src/models/data/passwordHistoryData.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user