Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-2818] Export error classes #508

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/handlers/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import { HandlerError } from '../utils/errors';
* });
* ```
*
* @throws {@Link HandlerError}
*
* @category Server
*/
export type AfterCallback = (
Expand Down Expand Up @@ -95,6 +97,8 @@ export interface CallbackOptions {
/**
* The handler for the `api/auth/callback` route.
*
* @throws {@Link HandlerError}
*
* @category Server
*/
export type HandleCallback = (req: NextApiRequest, res: NextApiResponse, options?: CallbackOptions) => Promise<void>;
Expand Down
2 changes: 2 additions & 0 deletions src/handlers/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export interface LoginOptions {
/**
* The handler for the `api/auth/login` route.
*
* @throws {@Link HandlerError}
*
* @category Server
*/
export type HandleLogin = (req: NextApiRequest, res: NextApiResponse, options?: LoginOptions) => Promise<void>;
Expand Down
2 changes: 2 additions & 0 deletions src/handlers/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface LogoutOptions {
/**
* The handler for the `api/auth/logout` route.
*
* @throws {@Link HandlerError}
*
* @category Server
*/
export type HandleLogout = (req: NextApiRequest, res: NextApiResponse, options?: LogoutOptions) => Promise<void>;
Expand Down
2 changes: 2 additions & 0 deletions src/handlers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export type ProfileOptions = {
/**
* The handler for the `/api/auth/me` route.
*
* @throws {@Link HandlerError}
*
* @category Server
*/
export type HandleProfile = (req: NextApiRequest, res: NextApiResponse, options?: ProfileOptions) => Promise<void>;
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export {
WithPageAuthRequiredProps
} from './frontend';

export { AccessTokenError, HandlerError } from './utils/errors';

export {
ConfigParameters,
HandleAuth,
Expand Down
2 changes: 2 additions & 0 deletions src/session/get-access-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface GetAccessTokenResult {
/**
* Get an Access Token to access an external API.
*
* @throws {@Link AccessTokenError}
*
* @category Server
*/
export type GetAccessToken = (
Expand Down