import * as bcrypt from 'bcrypt' ; import { Account } from '@btcp/bootcamp-entities' ; export class EncryptUser { async encryptUser ( user ) { const saltRounds = 10 ; const salt = await bcrypt . genSalt ( saltRounds ) ; const hashed = await bcrypt . hash ( user . pw , salt ) ; user . pw = hashed ; user . pwSalt = salt ; } }