huridocs/uwazi

View on GitHub
app/api/auth/encryptPassword.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import bcrypt from 'bcryptjs';

const saltRounds = 10;

const encryptPassword = async plainPassword => bcrypt.hash(plainPassword, saltRounds);
const comparePasswords = async (plain, hashed) => bcrypt.compare(plain, hashed);

export { comparePasswords, encryptPassword };