UNPKG

@jhvjkcyyfdxghjk/passport-openidconnect

Version:

OpenID Connect authentication strategy for Passport - without forced openid scope.

38 lines (35 loc) 849 B
/** * `TokenError` error. * * TokenError represents an error received from a token endpoint. For details, * refer to RFC 6749, section 5.2. * * References: * - [The OAuth 2.0 Authorization Framework](http://tools.ietf.org/html/rfc6749) * * @param {String} [message] * @param {String} [code] * @param {String} [uri] * @param {Number} [status] * * @extends Error * @constructor * @api public */ function TokenError(message, code, uri, status) { Error.call(this); Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; this.message = message; this.code = code || "invalid_request"; this.uri = uri; this.status = status || 500; } /** * Inherit from `Error`. */ TokenError.prototype.__proto__ = Error.prototype; /** * Expose `TokenError`. */ module.exports = TokenError;