1- import type { RelayingParty , WebAuthnProviderType } from "../../providers/webauthn" ;
1+ import type { WebAuthnProviderType } from "../../providers/webauthn" ;
22import type { Account , Authenticator , Awaited , InternalOptions , RequestInternal , ResponseInternal , User } from "../../types" ;
33import type { Cookie } from "./cookie" ;
44import { AdapterError , AuthError , InvalidProvider , MissingAdapter , WebAuthnVerificationError } from "../../errors" ;
55import { webauthnChallenge } from "../actions/callback/oauth/checks" ;
6- import { VerifiedAuthenticationResponse , VerifiedRegistrationResponse , generateAuthenticationOptions , generateRegistrationOptions , verifyAuthenticationResponse , verifyRegistrationResponse } from "@simplewebauthn/server" ;
76import type {
87 AuthenticationResponseJSON ,
98 PublicKeyCredentialCreationOptionsJSON ,
@@ -13,6 +12,7 @@ import type {
1312import type { Adapter , AdapterAccount , AdapterAuthenticator } from "../../adapters" ;
1413import type { GetUserInfo } from "../../providers/webauthn" ;
1514import { randomString } from "./web" ;
15+ import type { VerifiedAuthenticationResponse , VerifiedRegistrationResponse } from "@simplewebauthn/server" ;
1616
1717export type WebAuthnRegister = "register"
1818export type WebAuthnAuthenticate = "authenticate"
@@ -198,7 +198,7 @@ export async function verifyAuthenticate(
198198 let verification : VerifiedAuthenticationResponse
199199 try {
200200 const relayingParty = provider . getRelayingParty ( options , request )
201- verification = await verifyAuthenticationResponse ( {
201+ verification = await provider . simpleWebAuthn . verifyAuthenticationResponse ( {
202202 ...provider . verifyAuthenticationOptions ,
203203 expectedChallenge,
204204 response : data as AuthenticationResponseJSON ,
@@ -274,7 +274,7 @@ export async function verifyRegister(
274274 let verification : VerifiedRegistrationResponse
275275 try {
276276 const relayingParty = provider . getRelayingParty ( options , request )
277- verification = await verifyRegistrationResponse ( {
277+ verification = await provider . simpleWebAuthn . verifyRegistrationResponse ( {
278278 ...provider . verifyRegistrationOptions ,
279279 expectedChallenge,
280280 response : data as RegistrationResponseJSON ,
@@ -336,7 +336,7 @@ async function getAuthenticationOptions(options: InternalOptionsWebAuthn, reques
336336 const relayingParty = provider . getRelayingParty ( options , request )
337337
338338 // Return the authentication options.
339- return await generateAuthenticationOptions ( {
339+ return await provider . simpleWebAuthn . generateAuthenticationOptions ( {
340340 ...provider . authenticationOptions ,
341341 rpID : relayingParty . id ,
342342 allowCredentials : authenticators ?. map ( ( a ) => ( {
@@ -375,7 +375,7 @@ async function getRegistrationOptions(
375375 const relayingParty = provider . getRelayingParty ( options , request )
376376
377377 // Return the registration options.
378- return await generateRegistrationOptions ( {
378+ return await provider . simpleWebAuthn . generateRegistrationOptions ( {
379379 ...provider . registrationOptions ,
380380 userID,
381381 userName : user . email ,
0 commit comments