I tried many methods online, but still cannot fix it. Please help me. Thanks.
This is module:
providers: [AuthService, LocalStrategy, JwtStrategy],
controllers: [AuthController],
This is local.strategy.ts
: And the console.log('the email is,',email)
doesn’t work at all
@Injectable()
export class LocalStrategy extends PassportStrategy(Strategy) {
constructor(private readonly usersService: UsersService) {
super({ usernameField: 'email',});
}
async validate(email: string, password: string) {
console.log('the email is,',email)
return this.usersService.validateUser(email, password);
}
}
this is guard:
@Injectable()
export class LocalAuthGuard extends AuthGuard('local') {}
This is controller:
@UseGuards(LocalAuthGuard)
@MessagePattern('client_auth_login')
async login(
@CurrentUser() user: UserDocument
) {
console.log(user)
return this.authService.login(user);
}
The console.log('the email is,',email)
doesn’t work at all
The request body is: