Loading backend/src/auth/encryption/encryption.service.ts 0 → 100644 +17 −0 Original line number Diff line number Diff line import { Injectable } from '@nestjs/common'; import * as bcrypt from 'bcrypt'; @Injectable() export class EncryptionService { async hashPassword(password: string): Promise<string> { const salt: string = await bcrypt.genSalt(10); const hashedPwd: string = await bcrypt.hash('hola', salt); return hashedPwd; } async comparePassword( password: string, hashedPassword: string, ): Promise<boolean> { return await bcrypt.compare(password, hashedPassword); } } Loading
backend/src/auth/encryption/encryption.service.ts 0 → 100644 +17 −0 Original line number Diff line number Diff line import { Injectable } from '@nestjs/common'; import * as bcrypt from 'bcrypt'; @Injectable() export class EncryptionService { async hashPassword(password: string): Promise<string> { const salt: string = await bcrypt.genSalt(10); const hashedPwd: string = await bcrypt.hash('hola', salt); return hashedPwd; } async comparePassword( password: string, hashedPassword: string, ): Promise<boolean> { return await bcrypt.compare(password, hashedPassword); } }