From f4d5f97c428efb70d3bd99e9004f8f1ab2c9c971 Mon Sep 17 00:00:00 2001 From: yiekheng Date: Sun, 3 May 2026 09:45:36 +0800 Subject: [PATCH] fix(web-auth): import WebAuthn JSON types from @simplewebauthn/types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In @simplewebauthn/server v11 the JSON response and transport types are no longer re-exported from the server package — they live in the sibling @simplewebauthn/types package. Adds the dep and switches the imports. --- web/app/auth-actions.ts | 6 ++++-- web/lib/auth-store.ts | 2 +- web/package.json | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/app/auth-actions.ts b/web/app/auth-actions.ts index 948185e..4439d7a 100644 --- a/web/app/auth-actions.ts +++ b/web/app/auth-actions.ts @@ -8,9 +8,11 @@ import { generateRegistrationOptions, verifyAuthenticationResponse, verifyRegistrationResponse, - type AuthenticationResponseJSON, - type RegistrationResponseJSON, } from "@simplewebauthn/server"; +import type { + AuthenticationResponseJSON, + RegistrationResponseJSON, +} from "@simplewebauthn/types"; import { getSession, setSession, diff --git a/web/lib/auth-store.ts b/web/lib/auth-store.ts index d21f1f1..7f6f845 100644 --- a/web/lib/auth-store.ts +++ b/web/lib/auth-store.ts @@ -1,7 +1,7 @@ import "server-only"; import { promises as fs } from "node:fs"; import path from "node:path"; -import type { AuthenticatorTransportFuture } from "@simplewebauthn/server"; +import type { AuthenticatorTransportFuture } from "@simplewebauthn/types"; const FILE_PATH = process.env.CM_AUTH_STORE_PATH ?? "/data/auth/passkeys.json"; diff --git a/web/package.json b/web/package.json index 2e77672..bdfe441 100644 --- a/web/package.json +++ b/web/package.json @@ -11,6 +11,7 @@ "dependencies": { "@simplewebauthn/browser": "^11.0.0", "@simplewebauthn/server": "^11.0.0", + "@simplewebauthn/types": "^11.0.0", "iron-session": "^8.0.0", "next": "15.1.0", "react": "19.0.0",