Skip to main content

NAuthAdapter

Package: @nauth-toolkit/core Type: Interface

Contract for framework adapters that register middleware/hooks and manage AsyncLocalStorage request context.

import { NAuthAdapter } from '@nauth-toolkit/nestjs';

Properties

PropertyTypeDescription
namestring (readonly)Adapter name for logging/debugging (e.g., 'express', 'fastify')

Methods

MethodReturnsDescription
registerMiddleware(name, handler, options?)unknownRegister a middleware handler. name is a string identifier (e.g., 'auth'), handler is a NAuthMiddlewareHandler, options is optional MiddlewareOptions.
registerResponseInterceptor(handler)unknownRegister a response interceptor for token delivery. handler is a NAuthResponseInterceptorHandler.
wrapRouteHandler(handler)unknownWrap a route handler to ensure AsyncLocalStorage context is available.