authrix
Version:
Lightweight, flexible authentication library for Node.js and TypeScript.
1 lines • 292 B
JavaScript
import {b}from'./chunk-GACMQPPZ.mjs';import*as e from'jsonwebtoken';function o(r){if(!b.jwtSecret||b.jwtSecret.length<12)throw new Error("Auth not initialized: jwtSecret is missing or too short. Call initAuth({ jwtSecret, db }).");return e.sign(r,b.jwtSecret,{expiresIn:"7d"})}export{o as a};