All files / components/password-hash password-hash.service.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 3/3
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 153x     3x       3x       1x      
import * as argon2 from 'argon2';
import { IPasswordHashService } from './interfaces/password-hash-service.interface';
 
export class PasswordHashService implements IPasswordHashService {
  constructor() {}
 
  async hashPassword(password: string): Promise<string> {
    return await argon2.hash(password);
  }
 
  async verify(password: string, hash: string): Promise<boolean> {
    return await argon2.verify(hash, password);
  }
}