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

Bun runtime TypeError #476

Closed JayAgra closed 1 year ago

JayAgra commented 1 year ago

Describe the issue

verifyRegistrationResponse.js throws TypeError: Right side of assignment cannot be destructured. I am not sure if this is a compatibility issue with the bun runtime, or with my implementation.

Reproduction Steps

Construct a near-exact copy of example code, and run it in bunjs runtime.

Expected behavior

Should verify passkey creation without error

Code Samples + WebAuthn Options and Responses

(SimpleWebAuthn main file) https://github.com/JayAgra/bearTracks/blob/auth/routes/api/auth/passkey/passkey.ts (where that file is imported) https://github.com/JayAgra/bearTracks/blob/afc10e525f1dcc8e15a74c3d54cfe9d62a5d8671/serve.ts#L726 (client for creation, js linked in file) https://github.com/JayAgra/bearTracks/blob/auth/src/passkey.html (client for login, js linked in file) https://github.com/JayAgra/bearTracks/blob/auth/src/login.html

Dependencies

SimpleWebAuthn Libraries

$ npm list --depth=0 | grep @simplewebauthn
├── @simplewebauthn/server@8.3.5
├── @simplewebauthn/typescript-types@8.3.4
# ...

Additional context

using bun 1.0.7

JayAgra commented 1 year ago

There is no issues with this library- I forgot to parse my request body as a JSON!