hello i have a problem with authgaurds.
My problem is what every i do i always recive a 401 stauts code and the canActivate method in the guard not even getting called:
Controller:
export class LeadController {
private readonly logger = new Logger(LeadController.name);
constructor() {}
@Post()
@UseGuards(ApikeyGuard)
create(@Body() createLeadDto: CreateLeadDto, @Req() request: Request) {
return 'valid';
}
}
Guard:
@Injectable()
export class ApiKeyGuard implements CanActivate {
private readonly logger = new Logger(ApikeyGuard.name);
constructor() {} // private readonly zohoAuthService: ZohoAuthService, // private zohoService: ZohoRestService,
async canActivate(context: ExecutionContext): Promise<boolean> {
this.logger.log('called');
return true;
}
}
did i have missed something ?