@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 722 B
JavaScript
import{copy as e}from"../../libs/i18n/copy.mjs";import{decrypt as t}from"../../utils/helpers/encrypt-decrypt.mjs";import n from"../../libs/repositories/options.mjs";import{getLicenseOptionName as r}from"../license/helpers/option-names.mjs";const i=async i=>{let a=new n(i.db.client,i.config.db),o=i.request.tenantKey??null,s=await a.selectSingle({select:[`name`,`value_text`],where:[{key:`name`,operator:`=`,value:r(o,`license_key`)}]});if(s.error)return s;let c=s.data?.value_text,l=c?t(c,i.config.secrets.encryption):void 0;return l?.trim()?{error:void 0,data:l}:{error:{type:`basic`,status:400,message:e(`server:core.license.is.not.set`)},data:void 0}};export{i as default};
//# sourceMappingURL=get-license-key.mjs.map