UNPKG

@lucidcms/core

Version:

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

1 lines 672 B
{"version":3,"file":"generate-secret.mjs","names":[],"sources":["../../../src/utils/helpers/generate-secret.ts"],"sourcesContent":["import crypto from \"node:crypto\";\nimport { encrypt } from \"../helpers/encrypt-decrypt.js\";\n\nconst generateSecret = (\n\tencryptionKey: string,\n): {\n\tsecret: string;\n\tencryptSecret: string;\n} => {\n\tconst secret = crypto.randomBytes(32).toString(\"hex\");\n\n\treturn {\n\t\tsecret: secret,\n\t\tencryptSecret: encrypt(secret, encryptionKey),\n\t};\n};\n\nexport default generateSecret;\n"],"mappings":"2EAGA,MAAM,EACL,GAII,CACJ,IAAM,EAAS,EAAO,YAAY,EAAE,CAAC,CAAC,SAAS,KAAK,EAEpD,MAAO,CACE,SACR,cAAe,EAAQ,EAAQ,CAAa,CAC7C,CACD"}