mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: generate secure secret key and prevent default
This commit is contained in:
1 parent
b9a79eb435
commit
f18ec35a9f
11 files changed
+45
-5
No files matched your search
@@ -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()
|
||||
}
|
||||
Reference in new issue
Block a user