ui: fix security keys render error

This commit is contained in:
Matthew Penner 2021-09-11 16:22:58 -06:00
parent e384c0d5c3
commit 42bfaf9a19
No known key found for this signature in database
GPG Key ID: 030E4AB751DC756F

View File

@ -4,14 +4,14 @@ export interface WebauthnKey {
id: number;
name: string;
createdAt: Date;
lastUsedAt: Date;
lastUsedAt: Date | undefined;
}
export const rawDataToWebauthnKey = (data: any): WebauthnKey => ({
id: data.id,
name: data.name,
createdAt: new Date(data.created_at),
lastUsedAt: new Date(data.last_used_at) || new Date(),
lastUsedAt: data.last_used_at ? new Date(data.last_used_at) : undefined,
});
export default (): Promise<WebauthnKey[]> => {