@httpc/kit
Version:
httpc toolbox for building function-based API with minimal code and end-to-end type safety
9 lines (8 loc) • 435 B
TypeScript
import { HttpCServerMiddleware } from "@httpc/server";
import { JwtPayload } from "./JwtService";
export type AuthenticationBearerMiddlewareOptions = {
jwtSecret?: string;
onAuthenticate?: (token: string) => Promise<IUser>;
onDecode?: (payload: JwtPayload) => IUser | Promise<IUser>;
};
export declare function AuthenticationBearerMiddleware(options?: AuthenticationBearerMiddlewareOptions): HttpCServerMiddleware;