mongoose-encryption icon indicating copy to clipboard operation
mongoose-encryption copied to clipboard

decryptPostSave: true does not work if field is immutable

Open jinusean opened this issue 4 years ago • 1 comments

A schema with field options immutable: true will return the field as undefined on save even if decryptPostSave: true.

The field is decrypted on find however.

jinusean avatar Jan 26 '21 08:01 jinusean

Thanks for reporting this. Sounds like a bug!

Don't currently have any tests for the use of immutable - would be great to add them.

I don't have much time to work on this plugin these days, but am very happy to review any tested PRs :)

joegoldbeck avatar Jan 27 '21 03:01 joegoldbeck