Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/471-more-resilient-getwebcrypto #472

Merged
merged 3 commits into from
Oct 28, 2023

Conversation

MasterKale
Copy link
Owner

@MasterKale MasterKale commented Oct 28, 2023

This PR refines the changes made to getWebCrypto() in #468 by moving the try / catch into _getWebCryptoInternals.stubThisImportNodeCrypto. This should prevent non-Node runtimes from A) getting hung up on the use of import() or B) trying to use it to import a Node-specific identifier.

Fixes #471.

In an effort to confirm the fix, I tested these changes in the following "edge runtimes":

I tested with the following code:

import { generateAuthenticationOptions } from '@simplewebauthn/server';

// ...

const opts = await generateAuthenticationOptions(); 

Proof

Astro

Screenshot 2023-10-27 at 8 48 10 PM

CloudFlare Worker

Screenshot 2023-10-27 at 8 42 20 PM

@MasterKale MasterKale merged commit 9c12612 into master Oct 28, 2023
2 checks passed
@MasterKale MasterKale deleted the fix/471-more-resilient-getwebcrypto branch October 28, 2023 03:59
@MasterKale MasterKale added the package:server @simplewebauthn/server label Oct 28, 2023
@MasterKale MasterKale added this to the v8.3.5 milestone Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:server @simplewebauthn/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8.3.4 fails to build for edge deployment
1 participant