feat: add user createOne and refactor code
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { HashingProvider } from './hashing.provider';
|
||||
import * as bcrypt from 'bcrypt';
|
||||
@@ -8,9 +5,9 @@ import * as bcrypt from 'bcrypt';
|
||||
@Injectable()
|
||||
export class BcryptProvider implements HashingProvider {
|
||||
public async hash(data: string | Buffer): Promise<string> {
|
||||
const salt = (await bcrypt.genSalt()) as string;
|
||||
const salt = await bcrypt.genSalt();
|
||||
|
||||
return (await bcrypt.hash(data, salt)) as string;
|
||||
return await bcrypt.hash(data, salt);
|
||||
}
|
||||
|
||||
public async compare(
|
||||
|
||||
Reference in New Issue
Block a user