express-jwt-permissions
Version:
Express middleware for JWT permissions
15 lines (10 loc) • 309 B
JavaScript
const util = require('util')
module.exports = function UnauthorizedError (code, error) {
Error.captureStackTrace(this, this.constructor)
this.name = this.constructor.name
this.message = error.message
this.code = code
this.status = 403
this.inner = error
}
util.inherits(module.exports, Error)