Skip to content

Latest commit

 

History

History
82 lines (51 loc) · 2.41 KB

File metadata and controls

82 lines (51 loc) · 2.41 KB

InvalidTokenError

The access token provided is expired, revoked, malformed, or invalid for other reasons. See :rfc:`Section 3.1 of RFC 6750 <6750#section-3.1>`.

const InvalidTokenError = require('@node-oauth/oauth2-server/lib/errors/invalid-token-error');

new InvalidTokenError(message, properties)

Instantiates an InvalidTokenError.

Arguments:

Name Type Description
[message=undefined] String|Error See :ref:`OAuthError#constructor`.
[properties={}] Object See :ref:`OAuthError#constructor`.
[properties.code=401] Object See :ref:`OAuthError#constructor`.
[properties.name='invalid_token'] String The error name used in responses generated from this error.

Return value:

A new instance of InvalidTokenError.

Remarks:

const err = new InvalidTokenError();
// err.message === 'Unauthorized'
// err.code === 401
// err.name === 'invalid_token'

message

See :ref:`OAuthError#message <OAuthError#message>`.


code

Typically 401. See :ref:`OAuthError#code <OAuthError#code>`.


inner

See :ref:`OAuthError#inner <OAuthError#inner>`.


name

Typically 'invalid_token'. See :ref:`OAuthError#name <OAuthError#name>`.