tsndr / cloudflare-worker-jwt

A lightweight JWT implementation with ZERO dependencies for Cloudflare Workers.
MIT License
649 stars 51 forks source link

Fix verification relying on a signing key #65

Closed nickthegroot closed 7 months ago

nickthegroot commented 7 months ago

When attempting to use the library to validate an incoming JWT against an authentication server, I was seeing errors importing the key.

Uncaught (in promise) DOMException: Cannot create a key using the specified key usages.

This PR fixes the issue to only import keys based on their needed usage.

tsndr commented 7 months ago

Thank you for your contribution, always appreciated :)