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_NO: z.string(),
|
||||||
SEAMLESS_LOGOUT_SV: z.string(),
|
SEAMLESS_LOGOUT_SV: z.string(),
|
||||||
WEBVIEW_ENCRYPTION_KEY: z.string(),
|
WEBVIEW_ENCRYPTION_KEY: z.string(),
|
||||||
|
BOOKING_ENCRYPTION_KEY: z.string(),
|
||||||
|
NODE_OPTIONS: z.string(),
|
||||||
},
|
},
|
||||||
emptyStringAsUndefined: true,
|
emptyStringAsUndefined: true,
|
||||||
runtimeEnv: {
|
runtimeEnv: {
|
||||||
@@ -101,5 +103,7 @@ export const env = createEnv({
|
|||||||
SEAMLESS_LOGOUT_NO: process.env.SEAMLESS_LOGOUT_NO,
|
SEAMLESS_LOGOUT_NO: process.env.SEAMLESS_LOGOUT_NO,
|
||||||
SEAMLESS_LOGOUT_SV: process.env.SEAMLESS_LOGOUT_SV,
|
SEAMLESS_LOGOUT_SV: process.env.SEAMLESS_LOGOUT_SV,
|
||||||
WEBVIEW_ENCRYPTION_KEY: process.env.WEBVIEW_ENCRYPTION_KEY,
|
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 crypto from "crypto"
|
||||||
|
|
||||||
|
import { env } from "@/env/server"
|
||||||
|
|
||||||
export default function encryptValue(originalString: string) {
|
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")
|
const bufferKey = Buffer.from(encryptionKey, "utf8")
|
||||||
let cipher = crypto.createCipheriv("DES-ECB", bufferKey, null)
|
let cipher = crypto.createCipheriv("DES-ECB", bufferKey, null)
|
||||||
cipher.setAutoPadding(false)
|
cipher.setAutoPadding(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user