Skip to content

Commit

Permalink
refatored variable acess function
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavanakarwade committed Dec 17, 2024
1 parent 04a8656 commit f0e59f3
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,7 +221,7 @@ export const addPasskeyUserDetails = async(payload: AddPassword, email:string) =
}

export const passwordEncryption = (password: string): string => {
const CRYPTO_PRIVATE_KEY: string = envConfig.PUBLIC_CRYPTO_PRIVATE_KEY;
const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}`;
console.log("🚀 ~ passwordEncryption ~ CRYPTO_PRIVATE_KEY:", CRYPTO_PRIVATE_KEY)
const encryptedPassword: string = CryptoJS.AES.encrypt(JSON.stringify(password), CRYPTO_PRIVATE_KEY).toString()
return encryptedPassword
Expand All @@ -231,7 +231,7 @@ export const encryptData = (value: any): string => {

console.log("All env variables:", import.meta.env);

const CRYPTO_PRIVATE_KEY: string = envConfig.PUBLIC_CRYPTO_PRIVATE_KEY;
const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}`;
console.log("🚀 ~ encryptData ~ CRYPTO_PRIVATE_KEY:", CRYPTO_PRIVATE_KEY)

try {
Expand All @@ -247,7 +247,7 @@ export const encryptData = (value: any): string => {
}

export const decryptData = (value: any): string => {
const CRYPTO_PRIVATE_KEY: string = envConfig.PUBLIC_CRYPTO_PRIVATE_KEY;
const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}`;
console.log("🚀 ~ decryptData ~ CRYPTO_PRIVATE_KEY:", CRYPTO_PRIVATE_KEY)

try {
Expand Down

0 comments on commit f0e59f3

Please sign in to comment.