Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
}

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nestjs #mongoose #ClassSerializerInterceptor #working
ADD COMMENT
Topic
Name
2+1 =