DEV Community

Discussion on: Authentication in Node.js with MongoDB, bcrypt, and JWT web Tokens with cookiesย ๐Ÿช.

Collapse
 
solomonxuche profile image
Solomon Uche

On the area where you encrypted the password, after destructuring request body, you recreated the password.
Which is supposed to produce an error identifier already exist because const variable cannot be recreated.

Collapse
 
nyctonio profile image
Ritesh Kumar

Actually on destructuring the request body i am creating email and plaintextpassword and after that i created const password so there is no recreation ๐Ÿ˜‡ thats why it didn't produced error.