auth0 / express-jwt

connect/express middleware that validates a JsonWebToken (JWT) and set the req.user with the attributes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Instance of UnauthorizedError couldn't be checked with instanceof

arthurchumak opened this issue · comments

Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Description

Instance of UnauthorizedError couldn't be checked with instanceof

Reproduction

package.json

{
  "main": "index.js",
  "type": "module",
  "dependencies": {
    "express-jwt": "^7.7.1"
  }
}

index.js

import { UnauthorizedError } from 'express-jwt';

const e = new UnauthorizedError('credentials_bad_format', new Error('a'));

console.log(e instanceof UnauthorizedError);

log

node index.js 
false

Environment

Please provide the following:

  • Version of this library used: 7.7.1
  • Version of the platform or framework used, if applicable: no
  • Other relevant versions (language, server software, OS, browser): linux, node.js 16.14.2; npm 8.3.2
  • Other modules/plugins/libraries that might be involved:

Thank you very much for reporting this. It is fixed in v7.7.2

@jfromaniello thanks you too, for such quick response!