chore(server): remove bcrypt to avoid node-gyp usage (#2349)

This commit is contained in:
LongYinan
2023-05-13 02:48:38 +08:00
committed by GitHub
parent b5a7f8b7eb
commit 00fd468e9b
7 changed files with 147 additions and 73 deletions

View File

@@ -3,8 +3,8 @@ import {
Injectable,
UnauthorizedException,
} from '@nestjs/common';
import { compare, hash } from '@node-rs/bcrypt';
import { User } from '@prisma/client';
import { compare, hash } from 'bcrypt';
import jwt from 'jsonwebtoken';
import { Config } from '../../config';
@@ -69,7 +69,7 @@ export class AuthService {
}
async register(name: string, email: string, password: string): Promise<User> {
const hashedPassword = await hash(password, this.config.auth.salt);
const hashedPassword = await hash(password);
const user = await this.prisma.user.findFirst({
where: {