Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 18 lines 584 B view raw
1import { promisify } from 'util'; 2import bcrypt from 'bcryptjs'; 3 4export async function hashPassword(rawPassword: string) { 5 return bcrypt.hash(rawPassword, 5); 6} 7 8// Matches the bcrypt.compare semantics used by the now-removed Sequelize 9// `User.passwordMatchesHash` static; kept here so `UserApi.changePassword` and 10// the Passport local strategy share a single implementation. 11const bcryptCompare = promisify(bcrypt.compare); 12 13export async function passwordMatchesHash( 14 givenPassword: string, 15 hash: string, 16): Promise<boolean> { 17 return bcryptCompare(givenPassword, hash); 18}