fix: displayName return undefined and drop displayName from user table (#505)
This commit is contained in:
@ -11,6 +11,7 @@ import { RegisterInput } from '../dto/register.input';
|
||||
import { PASSWORD_REGEX, compareHash, hashPassword } from '../auth.util';
|
||||
import { Verify } from '../dto/verify.entity';
|
||||
import { TokenService } from './token.service';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
export type UserPayload = {
|
||||
firstName: string;
|
||||
@ -74,11 +75,17 @@ export class AuthService {
|
||||
return user;
|
||||
}
|
||||
|
||||
async verify(email: string): Promise<Verify> {
|
||||
async verify(
|
||||
email: string,
|
||||
select: Prisma.UserSelect & {
|
||||
id: true;
|
||||
},
|
||||
): Promise<Verify> {
|
||||
const user = await this.userService.findUnique({
|
||||
where: {
|
||||
email,
|
||||
},
|
||||
select,
|
||||
});
|
||||
|
||||
assert(user, "This user doesn't exist", NotFoundException);
|
||||
|
||||
Reference in New Issue
Block a user