tisn.app icon indicating copy to clipboard operation
tisn.app copied to clipboard

Documents with `emailConfirmed: false` and a non-null `emailConfirmedAt`

Open AlbertoPdRF opened this issue 4 years ago • 2 comments

Describe the bug There are some documents on the database with a non-null emailConfirmedAt attribute but with emailConfirmed: false.

To Reproduce Not sure why it happens, it needs to be investigated.

Expected behavior If the email is not confirmed (i.e. if emailConfirmed: false), emailConfirmedAt must be null.

AlbertoPdRF avatar Jul 27 '20 15:07 AlbertoPdRF

I don't think it's possible for emailConfirmedAt to be null as it is described in Schema emailConfirmedAt: { type: Date },

idiglove avatar Oct 11 '20 02:10 idiglove

Actually, emailConfirmedAt is never null per se, but unless a user's email is confirmed, it isn't present on the corresponding document. The bug here is that there are users with an emailConfirmedAt value that have an emailConfirmed value of false, which shouldn't happen.

If you'd like to dig deeper into this, let me know and I'll assign the issue to you! 🙂

AlbertoPdRF avatar Oct 11 '20 09:10 AlbertoPdRF