@dynamatix/gb-schemas 0.21.9 → 0.21.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/encryption.js +1 -1
package/package.json
CHANGED
package/utils/encryption.js
CHANGED
|
@@ -28,7 +28,7 @@ export const encryptObject = (obj, collectionName) => {
|
|
|
28
28
|
let encryptedObj = {};
|
|
29
29
|
|
|
30
30
|
for (const key in obj) {
|
|
31
|
-
if (key === "_id") {
|
|
31
|
+
if (key === "_id" || mongoose.isValidObjectId(obj[key])) {
|
|
32
32
|
encryptedObj[key] = obj[key]; // Don't encrypt _id
|
|
33
33
|
} else {
|
|
34
34
|
const iv = crypto.randomBytes(IV_LENGTH); // Generate IV
|