import { Injectable } from '@nestjs/common' ; import { PassportStrategy } from '@nestjs/passport' ; import { Strategy } from 'passport-local' ; import { AuthService } from '../auth.service' ; import { User } from '../../users/user.entity' ; @ Injectable ( ) export class LocalStrategy extends PassportStrategy ( Strategy ) { constructor ( private readonly authService ) { super ( { usernameField : 'email' , } ) ; } validate ( email , password ) { return this . authService . validateUser ( email , password ) ; } }