diff --git a/src/api/Auth.ts b/src/api/Auth.ts index 86e3554f..9d733cb0 100644 --- a/src/api/Auth.ts +++ b/src/api/Auth.ts @@ -221,14 +221,14 @@ export const addPasskeyUserDetails = async(payload: AddPassword, email:string) = } export const passwordEncryption = (password: string): string => { - const CRYPTO_PRIVATE_KEY: string = import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY; + const CRYPTO_PRIVATE_KEY: string = process.env.PUBLIC_CRYPTO_PRIVATE_KEY || import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY; const encryptedPassword: string = CryptoJS.AES.encrypt(JSON.stringify(password), CRYPTO_PRIVATE_KEY).toString() return encryptedPassword } export const encryptData = (value: any): string => { - const CRYPTO_PRIVATE_KEY = import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY; + const CRYPTO_PRIVATE_KEY: string = process.env.PUBLIC_CRYPTO_PRIVATE_KEY || import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY; try { if (typeof (value) !== 'string') { @@ -243,7 +243,7 @@ export const encryptData = (value: any): string => { } export const decryptData = (value: any): string => { - const CRYPTO_PRIVATE_KEY: string = import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY; + const CRYPTO_PRIVATE_KEY: string = process.env.PUBLIC_CRYPTO_PRIVATE_KEY || import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY; try { let bytes = CryptoJS.AES.decrypt(value, CRYPTO_PRIVATE_KEY);