module.exports=[792198,e=>{"use strict";var t=e.i(827957),r=e.i(709939),n=e.i(902157),a=e.i(750227),i=e.i(666680),u=e.i(499104);let o=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let e=a.default.join(u.DATA_DIR,"jwt-secret");try{return n.default.readFileSync(e,"utf8").trim()}catch{}n.default.mkdirSync(u.DATA_DIR,{recursive:!0});let t=i.default.randomBytes(32).toString("hex");return n.default.writeFileSync(e,t,{mode:384}),t}());function s(e){let t="true"===process.env.AUTH_COOKIE_SECURE,r=e?.headers?.get?.("x-forwarded-proto");return t||"https"===r}async function c(e={}){return new t.SignJWT({authenticated:!0,...e}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(o)}async function d(e){if(!e)return!1;try{return await (0,r.jwtVerify)(e,o),!0}catch{return!1}}async function l(e){if(!e)return null;try{let{payload:t}=await (0,r.jwtVerify)(e,o);return t}catch{return null}}async function h(e,t,r={}){let n=await c(r);e.set("auth_token",n,{httpOnly:!0,secure:s(t),sameSite:"lax",path:"/"})}e.s(["clearDashboardAuthCookie",0,function(e){e.delete("auth_token")},"getDashboardAuthSession",0,l,"setDashboardAuthCookie",0,h,"shouldUseSecureCookie",0,s,"verifyDashboardAuthToken",0,d])}];

//# sourceMappingURL=src_lib_auth_dashboardSession_0-67qhw.js.map