DEV Community

Discussion on: Authentication in NodeJS With Express and Mongo - CodeLab #1

Collapse
 
codecitrus profile image
Gautham

I noticed that we need to "await" on the existing user check before saving the new user. If I'm not mistaken, it would be possible for 2 identical request to "await" at this line at the same time, then both allowed to proceed to save duplicate users.

Any recommended way around this?

Anyways, thanks for article - learned a lot :)