fix(web-auth): import WebAuthn JSON types from @simplewebauthn/types

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.
This commit is contained in:
yiekheng 2026-05-03 09:45:36 +08:00
parent 312cc4dc21
commit f4d5f97c42
3 changed files with 6 additions and 3 deletions

View File

@ -8,9 +8,11 @@ import {
generateRegistrationOptions, generateRegistrationOptions,
verifyAuthenticationResponse, verifyAuthenticationResponse,
verifyRegistrationResponse, verifyRegistrationResponse,
type AuthenticationResponseJSON,
type RegistrationResponseJSON,
} from "@simplewebauthn/server"; } from "@simplewebauthn/server";
import type {
AuthenticationResponseJSON,
RegistrationResponseJSON,
} from "@simplewebauthn/types";
import { import {
getSession, getSession,
setSession, setSession,

View File

@ -1,7 +1,7 @@
import "server-only"; import "server-only";
import { promises as fs } from "node:fs"; import { promises as fs } from "node:fs";
import path from "node:path"; 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"; const FILE_PATH = process.env.CM_AUTH_STORE_PATH ?? "/data/auth/passkeys.json";

View File

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"@simplewebauthn/browser": "^11.0.0", "@simplewebauthn/browser": "^11.0.0",
"@simplewebauthn/server": "^11.0.0", "@simplewebauthn/server": "^11.0.0",
"@simplewebauthn/types": "^11.0.0",
"iron-session": "^8.0.0", "iron-session": "^8.0.0",
"next": "15.1.0", "next": "15.1.0",
"react": "19.0.0", "react": "19.0.0",