MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.62k stars 137 forks source link

fix/authenticator-transports-override #203

Closed MasterKale closed 2 years ago

MasterKale commented 2 years ago

I had to revisit how I tried to teach TypeScript about "cable" authenticator transport in #198. This time I followed the "Future" pattern I established with AuthenticatorAttestationResponseFuture and defined two new types:

These new values replace similarly named types referenced out of TypeScript's DOM lib, including in generateRegistrationOptions() and generateAuthenticationOptions() so these'll stop erroring out on code that is otherwise fine pre-5.2.0

This should allow me to continue adapting to changes to WebAuthn faster than TypeScript's DOM lib is able to while also making it straight-forward to remove these "Future" types for their contemporary counterparts when the DOM lib gets updated.