📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
fix server crash related to the invalid api key
Blue Mouse4ed994a16cbc
diff --git a/src/auth/guards/api-key-rate-limit.guard.ts b/src/auth/guards/api-key-rate-limit.guard.tsindex 0003c88ad..f6a029df9 100644--- a/src/auth/guards/api-key-rate-limit.guard.ts+++ b/src/auth/guards/api-key-rate-limit.guard.ts@@ -9,8 +9,9 @@ export class ApiKeyRateLimitGuard implements CanActivate {const user = request.userif (request.headers['x-api-key']) {- const reqAmount =- ACCOUNT_PLANS[user.planCode as PlanCode].maxApiKeyRequestsPerHour+ if (!user) return false++ const reqAmount = ACCOUNT_PLANS[user.planCode as PlanCode].maxApiKeyRequestsPerHourreturn await checkRateLimitForApiKey(user.apiKey, reqAmount)}