Skip to content

verifyJWT error TypeError: Cannot read property 'alg' of undefined #613

@lukepayyapilli

Description

@lukepayyapilli

I tried following the docs:

// simple validation for HS256
isValid = KJUR.jws.JWS.verifyJWT("eyJhbG...", "616161", {alg: ["HS256"]}),

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:

"typescript": "5.0.4",
"jsrsasign": "11.1.0",
"jsrsasign-util": "1.0.5"

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions