Skip to content

Commit

Permalink
changed variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavanakarwade committed Dec 17, 2024
1 parent f9d4f28 commit 9ba2b2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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);
Expand Down

0 comments on commit 9ba2b2a

Please sign in to comment.