fix: displayName return undefined and drop displayName from user table (#505)

This commit is contained in:
Jérémy M
2023-07-04 20:08:15 +02:00
committed by GitHub
parent d83313cd93
commit 6fc416da76
98 changed files with 128 additions and 222 deletions

View File

@ -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);