Answers for "nestjs mongoose ClassSerializerInterceptor not working"

0

nestjs mongoose ClassSerializerInterceptor not working

async validateUser(email: string, password: string): Promise<UserWithoutPassword | null> {
    const user = await this.usersService.findOne({ email });

    if (user && await compare(password, user.password))
    {
        return plainToClass(UserWithoutPassword, user.toObject());
    }

    return null;
}
Posted by: Guest on September-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language