Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score76%
Downloads2/wk
Published2 months ago (4.2.2)

A standards compliant implementation of an OAuth 2.0 authorization server for Nodejs that utilizes JWT and Proof Key for Code Exchange (PKCE), written in TypeScript.

function handleFastifyError
handleFastifyError(
e: unknown | OAuthException,
): void

Handles OAuth errors in Fastify applications. Converts OAuthExceptions to appropriate HTTP responses. Generic errors are automatically converted to 500 Internal Server Error.

Examples

Example 1

try {
  const oauthResponse = await authorizationServer.respondToAccessTokenRequest(req);
  return handleFastifyReply(res, oauthResponse);
} catch (e) {
  handleFastifyError(e, res);
}

Parameters

e: unknown | OAuthException
  • Error object, typically an OAuthException
  • Fastify Reply object

Return Type

void

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@jmondi/oauth2-server

Import symbol

import { handleFastifyError } from "@jmondi/oauth2-server/fastify";
or

Import directly with a jsr specifier

import { handleFastifyError } from "jsr:@jmondi/oauth2-server/fastify";

Add Package

pnpm i jsr:@jmondi/oauth2-server
or (using pnpm 10.8 or older)
pnpm dlx jsr add @jmondi/oauth2-server

Import symbol

import { handleFastifyError } from "@jmondi/oauth2-server/fastify";

Add Package

yarn add jsr:@jmondi/oauth2-server
or (using Yarn 4.8 or older)
yarn dlx jsr add @jmondi/oauth2-server

Import symbol

import { handleFastifyError } from "@jmondi/oauth2-server/fastify";

Add Package

vlt install jsr:@jmondi/oauth2-server

Import symbol

import { handleFastifyError } from "@jmondi/oauth2-server/fastify";

Add Package

npx jsr add @jmondi/oauth2-server

Import symbol

import { handleFastifyError } from "@jmondi/oauth2-server/fastify";

Add Package

bunx jsr add @jmondi/oauth2-server

Import symbol

import { handleFastifyError } from "@jmondi/oauth2-server/fastify";