@Injectable()
export class JwtAuthGuard extends AuthGuard('jwt') {
constructor(
private readonly authService: AuthService,
private readonly usersService: UsersService,
) {
super();
}
handleRequest(err, user, info: Error) {
if (!user) {
throw new UnauthorizedException();
}
console.log(user);
return user;
}
}