Skip to content

jsonwebtoken v9 verify function doesn't work in typescript #881

Closed
@akkadaya

Description

@akkadaya

After upgrading jsonwebtoken to v9, React-Native app written in Typescript can't verify the JWT and throws an error

[TypeError: right operand of 'instanceof' is not an object]
import jwt from 'jsonwebtoken'
...
try {
    return !!jwt.verify(token, publicKey)
} catch (error) {
    console.log(error)
    return false
}

But in a JavaScript file run by node it works fine!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions