express-jwt
express-jwt copied to clipboard
the returned `err.name` contains spaces
Description
the returned err.name
contains spaces.
Reproduction
app.use(expressjwt({
secret: SECRET,
algorithms: ['HS256']
}).unless({ path: unlesses }))
app.use((err, req, res, next) => {
if (err.name. === 'TokenExpiredError') {
console.log(1)
} else {
console.log(2)
}
})
if it is the above code, the log is always 2. but once you change it to err.name.trim(), everything works fine...
Environment
Please provide the following:
- **Version of this library used: 7.7.2
- **Version of the platform or framework used, if applicable: express
- **Other relevant versions (language, server software, OS, browser): javascript / nodejs