From 42bfaf9a1977ef67589af25a5cf382539a23fd12 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 11 Sep 2021 16:22:58 -0600 Subject: [PATCH] ui: fix security keys render error --- resources/scripts/api/account/webauthn/getWebauthnKeys.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/scripts/api/account/webauthn/getWebauthnKeys.ts b/resources/scripts/api/account/webauthn/getWebauthnKeys.ts index e1308553..c2e305de 100644 --- a/resources/scripts/api/account/webauthn/getWebauthnKeys.ts +++ b/resources/scripts/api/account/webauthn/getWebauthnKeys.ts @@ -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 => {