-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We received a report of this package failing with the following error: > TypeError: Right-hand side of 'instanceof' is not an object The stack trace pointed at the jsonwebtoken package as the source. At first it looked like this may be a problem on older versions of Node, but it turned out that they were using a relatively recent version (v18.17.1). It appears that a lot of other people may be running into a similar issue: - auth0/node-jsonwebtoken#939 - auth0/node-jsonwebtoken#892 People have reported success by either downgrading jsonwebtoken to v8 or replacing it with jose. Since we updated to jsonwebtoken v9 to fix a security vulnerability, I don't think it is a great idea to go back to v8. jose seems to be well-supported, healthy, and active: https://snyk.io/advisor/npm-package/jose Let's give this a shot! The API is a little bit different than jsonwebtoken, but for the most part I think the new version is simple enough to transition to. I set the alg properity to HS256, since it is required to specify the alg and that is what jsonwebtoken uses as the default. It seems that jose uses `||=` syntax which is not supported on node 14, so I am also removing the node 14 tests as part of this commit.
- Loading branch information
Showing
5 changed files
with
46 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters