Closed atinux closed 1 month ago
// import is optional import { hashPassword, verifyPassword } from '#auth-utils' const hash = hashPassword('user_password') // $2a$10$vEdoE9pqBlkJMqWmbk1JWuEYbJoansodgPo7a2GBkXsO8SleGXCr6 if (verifyPassword(existingHash, plainTextValue)) { // password is correct }
Demo from bcrypt-edge on https://github.com/atinux/nuxt-bcrypt-edge
The second argument of hashPassword is the same as hashSync
hashPassword
const hash = hashPassword('use_password', 12)
Demo from bcrypt-edge on https://github.com/atinux/nuxt-bcrypt-edge
The second argument of
hashPassword
is the same as hashSync