mejoras
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user