feat: generate secure secret key and prevent default

This commit is contained in:
Lin, Hung-Shin committed 2023-11-01 14:19:18 +08:00
1 parent b9a79eb435
commit f18ec35a9f
11 files changed
+45 -5

No files matched your search

+6 -1
View File
@@ -1,4 +1,5 @@
/* eslint-disable import/prefer-default-export */
import crypto from 'crypto'
export function get(key, defaultValue) {
const value = process.env[key]
if (value != null) {
@@ -6,3 +7,7 @@ export function get(key, defaultValue) {
}
return defaultValue
}
export function genSecret() {
return crypto.randomUUID()
}