@quarks/quarks-iam
Version:
A modern authorization server built to authenticate your users and protect your APIs
37 lines (28 loc) • 579 B
JavaScript
/**
* Module dependencies
*/
var util = require('util')
/**
* UnauthorizedError
*/
function UnauthorizedError (options, status) {
this.name = 'UnauthorizedError'
this.error = options.error
this.error_description = options.error_description
this.realm = options.realm
this.scope = options.scope
this.statusCode = options.statusCode || 401
}
util.inherits(UnauthorizedError, Error)
/**
* Error Codes
*/
UnauthorizedError.errorCodes = [
'invalid_request',
'invalid_token',
'insufficient_scope'
]
/**
* Exports
*/
module.exports = UnauthorizedError