Browse Source

mongodb

main
clement callaert 2 years ago
parent
commit
72b7f656d6
  1. 4
      routes/auth.js

4
routes/auth.js

@ -62,7 +62,7 @@ router.post('/creer-compte', async function (req, res) {
console.log("here2")
const existingUser = await db.getDb().collection('users').findOne({email: enteredEmail}) ||
db.getDb().collection('users').findOne({nom_dutilisateur: enteredNom_dutilisateur});
console.log(existingUser)
if (existingUser) {
req.session.inputData = {
hasError: true,
@ -80,7 +80,7 @@ router.post('/creer-compte', async function (req, res) {
});
return;
}
console.log("here3")
const hashedPassword = await bcrypt.hash(enteredPassword, 12);
const user = {

Loading…
Cancel
Save