feat: WEB-210 Replaced custom env with process.env
This commit is contained in:
4
env/server.ts
vendored
4
env/server.ts
vendored
@@ -57,6 +57,8 @@ export const env = createEnv({
|
||||
SEAMLESS_LOGOUT_NO: z.string(),
|
||||
SEAMLESS_LOGOUT_SV: z.string(),
|
||||
WEBVIEW_ENCRYPTION_KEY: z.string(),
|
||||
BOOKING_ENCRYPTION_KEY: z.string(),
|
||||
NODE_OPTIONS: z.string(),
|
||||
},
|
||||
emptyStringAsUndefined: true,
|
||||
runtimeEnv: {
|
||||
@@ -101,5 +103,7 @@ export const env = createEnv({
|
||||
SEAMLESS_LOGOUT_NO: process.env.SEAMLESS_LOGOUT_NO,
|
||||
SEAMLESS_LOGOUT_SV: process.env.SEAMLESS_LOGOUT_SV,
|
||||
WEBVIEW_ENCRYPTION_KEY: process.env.WEBVIEW_ENCRYPTION_KEY,
|
||||
BOOKING_ENCRYPTION_KEY: process.env.BOOKING_ENCRYPTION_KEY,
|
||||
NODE_OPTIONS: process.env.NODE_OPTIONS,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import crypto from "crypto"
|
||||
|
||||
import { env } from "@/env/server"
|
||||
|
||||
export default function encryptValue(originalString: string) {
|
||||
const encryptionKey = process.env.BOOKING_ENCRYPTION_KEY ?? ""
|
||||
const encryptionKey = env.BOOKING_ENCRYPTION_KEY
|
||||
const bufferKey = Buffer.from(encryptionKey, "utf8")
|
||||
let cipher = crypto.createCipheriv("DES-ECB", bufferKey, null)
|
||||
cipher.setAutoPadding(false)
|
||||
|
||||
Reference in New Issue
Block a user