verify-apple-id-token
verify-apple-id-token copied to clipboard
Support edge runtime compatibility (#1)
When attempting to use the current 3.0.1 verify-apple-id-token package in the Vercel Edge Runtime an error appears at build time related to the use of dynamic evaluation:
https://nextjs.org/docs/messages/edge-dynamic-code-evaluation
This PR provides a solution to this issue by replacing the jsonwebtoken and jwks-rsa libraries by jose which provides the same functionality in a single well supported package with albeit a slightly different API.
In this context, jose has the important characteristic of being compatible with various edge runtimes including Vercel's.
https://github.com/panva/jose#supported-runtimes
Fixes #171
@stefanprokopdev please review this PR when you have a moment. I can get by for my needs for the moment by using my fork.
Hey @kaaloo :wave: Thanks for the PR, it looks good to me!
Could you please run the npm run format
script? I think some of the code parts should be reformatted an there is also a missing EOL whitespace (in package.json). Would you be so nice and take a look at this stuff? We can merge it then :tada:
Hi @stefanprokopdev , thanks for your quick review! I updated my PR accordingly.
Thanks @kaaloo ! Are there any breaking changes? For example camelCase changed to snake_case or whatever? Just asking if are 100 % backward compatible or we need more changes or improvements (case sensitivity for example). I am not able to test it now because I dont have an active project :disappointed:
Hi, good question 😅 I unfortunately am not going with this in our project because I discovered an experimental supabase auth API that covers the full scope of my use case. Have you had issues with this type of breakage in the past?
Hi @stefanprokopdev sorry I've been travelling and had not had a moment to code. Will look at this shortly. Thanks for your careful review!