This commit is contained in:
xXpuma99Xx
2022-07-05 21:53:47 -05:00
parent 755db28c93
commit ae98fde192
31 changed files with 300 additions and 157 deletions
+4 -4
View File
@@ -6,6 +6,10 @@ import { ConfigService } from '@nestjs/config';
export class BcryptService {
constructor(private configService: ConfigService) {}
comparar(password: string, passwordDb: string) {
return bcrypt.compareSync(password, passwordDb);
}
encriptar(password: string) {
const salt = bcrypt.genSaltSync(
parseInt(this.configService.get<string>('SALT_ROUNDS')),
@@ -13,8 +17,4 @@ export class BcryptService {
return bcrypt.hashSync(password, salt);
}
comparar(password: string, passwordDb: string) {
return bcrypt.compareSync(password, passwordDb);
}
}