@auth0/nextjs-auth0
Version:
Auth0 Next.js SDK
108 lines (107 loc) • 3.27 kB
TypeScript
export declare abstract class SdkError extends Error {
abstract code: string;
}
/**
* Errors that come from Auth0 in the `redirect_uri` callback may contain reflected user input via the OpenID Connect `error` and `error_description` query parameter.
* You should **not** render the error `message`, or `error` and `error_description` properties without properly escaping them first.
*/
export declare class OAuth2Error extends SdkError {
code: string;
constructor({ code, message }: {
code: string;
message?: string;
});
}
export declare class DiscoveryError extends SdkError {
code: string;
constructor(message?: string);
}
export declare class MissingStateError extends SdkError {
code: string;
constructor(message?: string);
}
export declare class InvalidStateError extends SdkError {
code: string;
constructor(message?: string);
}
export declare class AuthorizationError extends SdkError {
code: string;
cause: OAuth2Error;
constructor({ cause, message }: {
cause: OAuth2Error;
message?: string;
});
}
export declare class AuthorizationCodeGrantRequestError extends SdkError {
code: string;
constructor(message?: string);
}
export declare class AuthorizationCodeGrantError extends SdkError {
code: string;
cause: OAuth2Error;
constructor({ cause, message }: {
cause: OAuth2Error;
message?: string;
});
}
export declare class BackchannelLogoutError extends SdkError {
code: string;
constructor(message?: string);
}
export declare class BackchannelAuthenticationNotSupportedError extends SdkError {
code: string;
constructor();
}
export declare class BackchannelAuthenticationError extends SdkError {
code: string;
cause?: OAuth2Error;
constructor({ cause }: {
cause?: OAuth2Error;
});
}
export declare enum AccessTokenErrorCode {
MISSING_SESSION = "missing_session",
MISSING_REFRESH_TOKEN = "missing_refresh_token",
FAILED_TO_REFRESH_TOKEN = "failed_to_refresh_token"
}
export declare class AccessTokenError extends SdkError {
code: string;
cause?: OAuth2Error;
constructor(code: string, message: string, cause?: OAuth2Error);
}
/**
* Enum representing error codes related to access tokens for connections.
*/
export declare enum AccessTokenForConnectionErrorCode {
/**
* The session is missing.
*/
MISSING_SESSION = "missing_session",
/**
* The refresh token is missing.
*/
MISSING_REFRESH_TOKEN = "missing_refresh_token",
/**
* Failed to exchange the refresh token.
*/
FAILED_TO_EXCHANGE = "failed_to_exchange_refresh_token"
}
/**
* Error class representing an access token for connection error.
* Extends the `SdkError` class.
*/
export declare class AccessTokenForConnectionError extends SdkError {
/**
* The error code associated with the access token error.
*/
code: string;
cause?: OAuth2Error;
/**
* Constructs a new `AccessTokenForConnectionError` instance.
*
* @param code - The error code.
* @param message - The error message.
* @param cause - The OAuth2 cause of the error.
*/
constructor(code: string, message: string, cause?: OAuth2Error);
}