Closed badoge closed 2 years ago
Issue is still there on 2.0.0
Unfortunatly, those changes make the test fail.
So if you can implement it without breaking HSxxx
I will merge it :)
I updated the PR to use the 2.0.0 source, but I'm not confident that it will be reliable and was instead thinking of adding an extra parameter to sign() and verify() to indicate that the secret is base64 encoded
fixes #15
I was still having the same issue with 1.4.1 but I played around with it and replacing https://github.com/tsndr/cloudflare-worker-jwt/blob/594cdd6c05e2b0f137a7d0b53340cd212a9e9ba5/index.js#L114 and https://github.com/tsndr/cloudflare-worker-jwt/blob/594cdd6c05e2b0f137a7d0b53340cd212a9e9ba5/index.js#L77
with
keyData = Base64URL.parse(secret)
fixed the issue for me but I also needed to add a check for non base64 secrets.