Skip to content

Commit 36cb13a

Browse files
committed
1 parent d628a79 commit 36cb13a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/auth-services/src/auth-server/middleware/apiKeyGate.express.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ export const apiKeyGate =
2121

2222
// lazy initialise redis based on cfg.redisUrl
2323
const url = cfg.redisUrl || process.env['REDIS_URL'];
24-
if (!url) return res.status(500).json({ error: 'redis_not_configured' });
24+
if (!url)
25+
return res
26+
.status(500)
27+
.json({
28+
error:
29+
'Redis configuration missing. API key tracking requires Redis to be configured.',
30+
});
2531
const client = getCachedRedisClient() || (await getRedisClient(url));
2632
const now = new Date();
2733
const trackingKey = `${now.getUTCFullYear()}-${now.getUTCMonth()}-${now.getUTCDate()}:${apiKey}`;

0 commit comments

Comments
 (0)