UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 609 B
import e from"../../utils/errors/lucid-error.mjs";import t from"node:crypto";const n={encryption:`lucid:secrets:encryption`,cookie:`lucid:secrets:cookie`,accessToken:`lucid:secrets:access-token`,refreshToken:`lucid:secrets:refresh-token`},r=(e,n)=>t.createHmac(`sha256`,e).update(n).digest(`hex`),i=t=>{if(t.length!==64)throw new e({message:`Lucid root secret must be 64 characters long.`})},a=e=>typeof e==`string`?(i(e),{encryption:r(e,n.encryption),cookie:r(e,n.cookie),accessToken:r(e,n.accessToken),refreshToken:r(e,n.refreshToken)}):e;export{a as default}; //# sourceMappingURL=normalize-secrets.mjs.map