mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
* [PM-4881]: Added userName to fido2credential * added user.name as input params * Fixed some type errors
31 lines
753 B
TypeScript
31 lines
753 B
TypeScript
import { Jsonify } from "type-fest";
|
|
|
|
import { ItemView } from "./item.view";
|
|
|
|
export class Fido2CredentialView extends ItemView {
|
|
credentialId: string;
|
|
keyType: "public-key";
|
|
keyAlgorithm: "ECDSA";
|
|
keyCurve: "P-256";
|
|
keyValue: string;
|
|
rpId: string;
|
|
userHandle: string;
|
|
userName: string;
|
|
counter: number;
|
|
rpName: string;
|
|
userDisplayName: string;
|
|
discoverable: boolean;
|
|
creationDate: Date = null;
|
|
|
|
get subTitle(): string {
|
|
return this.userDisplayName;
|
|
}
|
|
|
|
static fromJSON(obj: Partial<Jsonify<Fido2CredentialView>>): Fido2CredentialView {
|
|
const creationDate = obj.creationDate != null ? new Date(obj.creationDate) : null;
|
|
return Object.assign(new Fido2CredentialView(), obj, {
|
|
creationDate,
|
|
});
|
|
}
|
|
}
|