@mridang/nestjs-auth
Version:
A comprehensive Auth.js integration for NestJS applications with TypeScript support, framework-agnostic HTTP adapters, and role-based access control
23 lines (22 loc) • 1.13 kB
TypeScript
import type { ExecutionContext } from '@nestjs/common';
import type { FastifyReply, FastifyRequest } from 'fastify';
import { HttpAdapter } from './http.adapter.js';
import type { AuthenticatedRequest } from '../types.js';
import { Readable } from 'node:stream';
/**
* Fastify adapter for NestJS Auth.js module.
*/
export declare class FastifyAdapter extends HttpAdapter<FastifyRequest, FastifyReply> {
getRequest(context: ExecutionContext): AuthenticatedRequest;
getResponse(context: ExecutionContext): FastifyReply;
getProtocol(request: FastifyRequest): string;
getHost(request: FastifyRequest): string;
getUrl(request: FastifyRequest): string;
getMethod(request: FastifyRequest): string;
getHeaders(request: FastifyRequest): Record<string, string | string[] | undefined>;
getCookie(request: FastifyRequest): string | undefined;
getBody(request: FastifyRequest): unknown;
setHeader(response: FastifyReply, name: string, value: string | string[]): void;
setStatus(response: FastifyReply, code: number): void;
send(response: FastifyReply, body: string | Buffer | Readable): void;
}