authrix
Version:
Lightweight, flexible authentication library for Node.js and TypeScript.
1 lines • 865 B
JavaScript
export{b as createLogger,a as logger,c as reconfigureLogger}from'./chunk-A4X5QZSX.mjs';import {a}from'./chunk-5VQXQYKM.mjs';export{a as AuthrixError,b as BadRequestError,f as ConflictError,d as ForbiddenError,g as InternalServerError,e as NotFoundError,c as UnauthorizedError}from'./chunk-5VQXQYKM.mjs';export{e as generateSecurePassword,a as hashPassword,f as needsRehash,d as validatePassword,c as verifyAndCheckRehash,b as verifyPassword}from'./chunk-5NOQNI5F.mjs';import'./chunk-GACMQPPZ.mjs';import'./chunk-3SAEGOMQ.mjs';function v(r,o,e=200){let s={success:true,data:o};r.status(e).json(s);}function t(r,o,e=500){let s={success:false,error:{message:o}};r.status(e).json(s);}function T(r,o,e,s){return r instanceof a?t(e,r.message,r.statusCode):t(e,"An unexpected internal server error occurred.",500)}export{T as errorHandler,t as sendError,v as sendSuccess};