DEV Community

Discussion on: Authentication in Node.js with MongoDB, bcrypt, and JWT web Tokens with cookies 🍪.

Collapse
 
officialksolomon profile image
officialksolomon

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.