1async validateUser(email: string, password: string): Promise<UserWithoutPassword | null> {
2 const user = await this.usersService.findOne({ email });
3
4 if (user && await compare(password, user.password))
5 {
6 return plainToClass(UserWithoutPassword, user.toObject());
7 }
8
9 return null;
10}
11
12