diff --git a/env/server.ts b/env/server.ts index 37710a26b..1e0b2ba67 100644 --- a/env/server.ts +++ b/env/server.ts @@ -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, }, }) diff --git a/server/routers/utils/encryptValue.ts b/server/routers/utils/encryptValue.ts index 12caf6172..f934825cc 100644 --- a/server/routers/utils/encryptValue.ts +++ b/server/routers/utils/encryptValue.ts @@ -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)