Registration and login authentication in express js
UserController.js import userModel from "../models/User.js" ; import bcrypt from 'bcrypt' class userController { static home = ( req , res ) => { res . render ( "index" ); }; static registration = ( req , res ) => { res . render ( "registration" ); }; static createUserDoc = async ( req , res ) => { const hashPassword = await bcrypt . hash ( req . body . password , 10 ) console . log ( req . body ) try { const doc = new userModel ({ name : req . body . name , email : req . body . email , password : hashPassword , }); await doc . save (); res . redirect ( "/login" ); } catch ( error ) { console . log ( error ); } }; stat...