I am not sure about if I am us,ng bcrypt correctly.
This is my code that I tried to write.
app.post('/kayıt/', function(req, res){
bcrypt.genSalt(10, function(err, salt) {
bcrypt.hash(password, salt, function(err, hash) {
let user = new User({
isim:req.body.isim,
email:req.email.isim,
password:req.body:password,
});
user.save(function(err){
if(err){
console.log(err);
}else{
res.redirect('/');
});
Do you think that are there any errors ? Or the usage of bcrypt and user registration process made correctly.(Note: In my procet I have stuck in another code blocks about express-validator, so that I tried to write a code but I am not sure if it is correct or not)
So that can you tell me about these codes, if it is wrong what should I change, if it is not what elses are alternative to write this registration part?