Skip to content

Type authenticatorResponse in services.ts, cast at server.ts boundary#37

Merged
cfuehrmann merged 1 commit into
mainfrom
type-authenticator-response-in-services
Feb 14, 2026
Merged

Type authenticatorResponse in services.ts, cast at server.ts boundary#37
cfuehrmann merged 1 commit into
mainfrom
type-authenticator-response-in-services

Conversation

@cfuehrmann

Copy link
Copy Markdown
Owner

Summary

  • Types the authenticatorResponse parameter properly in services.ts using RegistrationResponseJSON / AuthenticationResponseJSON from @simplewebauthn/server
  • Moves the unknown → typed cast to server.ts where the public API boundary (unknown) meets the typed internals
  • Eliminates 3 as any casts and their eslint-disable comments from services.ts

Rationale

server.ts (createAuth public API) stays unknown to avoid coupling consumers to @simplewebauthn/server types. But services.ts is internal to the auth package and already depends on @simplewebauthn/server transitively — so it should be properly typed. The casts now live at the correct boundary in server.ts.

Files changed (2)

  • packages/fido2-auth/src/services.ts — proper types, no more as any
  • packages/fido2-auth/src/server.tsas RegistrationResponseJSON / as AuthenticationResponseJSON at boundary

Checks

  • Build passes
  • Lint passes
  • Format passes
  • Knip passes
  • Unit tests pass
  • All 11 e2e tests pass

@cfuehrmann cfuehrmann force-pushed the type-authenticator-response-in-services branch from 1a902dc to 43f88ab Compare February 14, 2026 19:18
@cfuehrmann cfuehrmann merged commit fe98666 into main Feb 14, 2026
6 checks passed
@cfuehrmann cfuehrmann deleted the type-authenticator-response-in-services branch February 14, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant