fix: get branch full working

This commit is contained in:
Rotimi Best
2025-11-25 17:18:15 +00:00
parent 8533e83f03
commit e0e3c8a01e
10 changed files with 396 additions and 327 deletions
-2
View File
@@ -49,7 +49,6 @@
"@sentry/profiling-node": "^7.110.1",
"@supabase/supabase-js": "^2.32.0",
"axios": "^1.4.0",
"bcrypt": "^6.0.0",
"dotenv": "^16.3.1",
"hono": "^4.9.7",
"hono-openapi": "^1.0.8",
@@ -62,7 +61,6 @@
"zod-openapi": "^5.4.1"
},
"devDependencies": {
"@types/bcrypt": "^6.0.0",
"@types/katex": "^0.16.7",
"@types/node": "^20.19.0",
"@typescript-eslint/eslint-plugin": "7.0.1",
+7
View File
@@ -8,6 +8,7 @@ import {
import type { MiddlewareHandler } from 'hono';
import { rateLimiter } from '@api/utils/redis/limiter';
import { userKeyGenerator } from '../utils/redis/key-generators';
import { env } from '@api/config/env';
export interface RateLimiterOptions {
windowMs?: number;
@@ -29,7 +30,13 @@ export const createRateLimiter = (options: RateLimiterOptions = {}): MiddlewareH
const opts = { ...defaultOptions, ...options };
return async (c, next) => {
// Skip rate limiting if not in production
if (env.NODE_ENV !== 'production') {
return await next();
}
try {
// Generate rate limit key
const key = opts.keyGenerator(c);