You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, despite passing in ['email'] as the value, dropping the encrypted collection, and then again creating encrypted user documents, the email field and email addresses still appear.
I'm not clear why it's still revealing the email, so I'm hoping this can be solved in this issue.
Have you tried checking to see if you are indexing email in your schema? if so the documentation says indexed fields will not be encrypted, secondly, have you tried encrypting only the email to see if it works? by adding the property encryptedFields: ['email']? if not, try it let us know. Also check the version of mongoose you are using and be sure it is up to date. I just checked now, you are making the email field unique, email: { type: String, trim: true, required: true, unique: true }, , as such it may not be encrypted. A unique field is equivalent to an indexed field internally.
Hello,
I am trying to save some mostly plain text user documents into a new collection encrypted using
mongoose-encryption
.When I tried, the expected fields of
_id
,_v
,_ct
, and_ac
appeared.However, the new encrypted documents also showed the prior
email
field and the email address unencrypted.Upon review, the README shows this can be solved by using
additionalAuthenticatedFields
, doing something like this:Unfortunately, despite passing in
['email']
as the value, dropping the encrypted collection, and then again creating encrypted user documents, theemail
field and email addresses still appear.I'm not clear why it's still revealing the
email
, so I'm hoping this can be solved in this issue.My Schema:
controller method:
Resulting 'encrypted' document example:
Please let me know how to also get the emails encrypted.
Thank you.
The text was updated successfully, but these errors were encountered: