I`m developing auth guard in nestjs, I got This error.
If I call .pipe()
async validateUser(email: string, password: string): Promise<User> {
const findUser = await this.userRepository.findOneBy({email: email, password: password });
if (!findUser) throw new NotFoundException("user not found");
return findUser;
}
login(user: User): Observable<string> {
const { email, password } = user;
return this.validateUser(email, password).pipe(
switchMap((user: User) => {
if (user) {
// create JWT - credwntials
return from(this.jwtServices.signAsync({ user }));
}
}),
);
}
This my authService.