authrix
Version:
Lightweight, flexible authentication library for Node.js and TypeScript.
1 lines • 895 B
JavaScript
;var r=Symbol.for("authrix.config.singleton"),n=class i{constructor(){this.t="";this.r=null;this.o="auth_token";}static getInstance(){return globalThis[r]||(globalThis[r]=new i),globalThis[r]}get jwtSecret(){return this.t}set jwtSecret(e){this.t=e;}get db(){return this.r}set db(e){this.r=e;}get cookieName(){return this.o}set cookieName(e){this.o=e;}init(e){this.t=e.jwtSecret,this.r=e.db,e.cookieName&&(this.o=e.cookieName);}},t=n.getInstance(),o={get jwtSecret(){return t.jwtSecret},set jwtSecret(i){t.jwtSecret=i;},get db(){return t.db},set db(i){t.db=i;},get cookieName(){return t.cookieName},set cookieName(i){t.cookieName=i;}};function s(i){t.init(i);}function a(){return !!(t.jwtSecret&&t.db)}function c(){return {jwtSecret:t.jwtSecret?"[PRESENT]":"[MISSING]",db:t.db?"[CONFIGURED]":"[NOT CONFIGURED]",cookieName:t.cookieName}}exports.a=o;exports.b=s;exports.c=a;exports.d=c;