-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
verifyJWT error TypeError: Cannot read property 'alg' of undefined #613
Comments
It doesn't seem your "token" value have an "alg" attribute with "HS256". |
it does - I copied my token to the site and was able to properly verify it. I'm using the exact same token and getting this error when calling Since this is local development(my secret I'm using is just My auth logic:
Logs:
|
any ideas @kjur? |
@lukepayyapilli , I tried verifyJWT and works fine for me. Could you provide the token and the secret which was failed? I can investigate further for it. |
@kjur it is included in the logs above: secret: |
Another interesting piece of information @kjur is that I'm using goja instead of node for my runtime with typescript. I'm not sure if that matters in this case but unfortunately I have to use goja. |
I tried following the docs:
This is what I'm running:
const isValid = KJUR.jws.JWS.verifyJWT(token, jwtSecret, {alg: ["HS256"]});
but this throws an error:
TypeError: Cannot read property 'alg' of undefined
Please let me know what I'm missing. It seems like according to the docs this should work.
I'm using these versions:
Thanks!
The text was updated successfully, but these errors were encountered: