Skip to content

Commit

Permalink
fix: cookie session
Browse files Browse the repository at this point in the history
  • Loading branch information
liorzblrn committed Feb 8, 2025
1 parent f9f46f9 commit d683a1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 16 additions & 0 deletions packages/common/src/utils/crypto/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import CryptoJS from 'crypto-js';

export const encryptData = (data: string, secret: string): string => {
// Encrypt the data using AES encryption
const encrypted = CryptoJS.AES.encrypt(data, secret).toString();

return encrypted;
};

export const decryptData = (encryptedData: string, secret: string): string => {
// Decrypt the data using AES decryption
const bytes = CryptoJS.AES.decrypt(encryptedData, secret);
const decrypted = bytes.toString(CryptoJS.enc.Utf8); // Convert decrypted bytes back to UTF-8 string

return decrypted;
};
17 changes: 0 additions & 17 deletions services/workflows-service/src/auth/crypto.ts

This file was deleted.

0 comments on commit d683a1d

Please sign in to comment.