Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

bcrypt

// Hash Password 
const hashedPassword = await bcrypt.hash(req.body.password, 10)
//compare password 
let password = await bcrypt.compare(req.body.password,user.password)
  if(!password){
            return next(CustomErrorHandler.wrongCredential())
        }
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #bcrypt
ADD COMMENT
Topic
Name
1+1 =