-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support edge runtime compatibility (#1) #172
base: main
Are you sure you want to change the base?
Conversation
* Use jose instead of jwks-rsa. Still need to verify nonce. * Verify nonce manually since there is no built-in support in jose * Replace jsonwebtoken by jose too * Mark as 3.0.1-jose version * Reset to previous package version * Ignore vscode settings * Use jose's decodeProjectedHeader for alg and kid * Fix tests
@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 👋 Thanks for the PR, it looks good to me! Could you please run the |
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 😞 |
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are just some minor request changes we can discuss.
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! |
Should be undefined but sound good to make sure Co-authored-by: Štefan Prokop <[email protected]>
Best practice not to log nonce values Co-authored-by: Štefan Prokop <[email protected]>
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