I am trying to verify my JWT token using the method jose.jwtVerify which expects token as first argument and key as a second argument. But this function throws the error Reference error: key is not defined.
Possible reason of the bug:
SCREEN SHOTS FROM V5.3.0
When jose is compiled, The function falttenVerify changes the argument name of key to z but on line no.84 code is still trying to find the variable named key which is now changed to z Due to which it throws the error key is not found.
I don't see the re-assignment of variable z to key anywhere before it's usage.
But when I downgrade the version from 5.3.0 to 5.2.4. It works just fine and the argument is now not changed to z and when requested in the code expression below it is able to find that variable.
What happened?
I am trying to verify my JWT token using the method
jose.jwtVerify
which expectstoken
as first argument andkey
as a second argument. But this function throws the errorReference error: key is not defined
.Possible reason of the bug:
SCREEN SHOTS FROM V5.3.0
When jose is compiled, The function falttenVerify changes the argument name of
key
toz
but on line no.84 code is still trying to find the variable named key which is now changed toz
Due to which it throws the errorkey
is not found.I don't see the re-assignment of variable
z
tokey
anywhere before it's usage.But when I downgrade the version from 5.3.0 to 5.2.4. It works just fine and the argument is now not changed to z and when requested in the code expression below it is able to find that variable.
Version
v5.3.0
Runtime
Node.js
Runtime Details
Node: V18.20.2, NPM: V10.5.0, PNPM: V9.1.0, MacOS: 13.6.7 (22G720)
Code to reproduce
Required