Skip to content

TypeError when token is not a string #304

Closed
@ricardogama

Description

@ricardogama

I started getting uncaught exceptions when receiving tokens that are not strings:

TypeError: jwtString.split is not a function

Since I'm only handling errors exposed by this library I expected a JsonWebTokenError to be thrown when verifying a value other than string.

I saw some issues related to this error but the focus was on throwing or return it on the callback. This way I suggest to test the type of the token before splitting it and throw a JsonWebTokenError if not a string.

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