feat(planning): ship holiday-aware planning and assistant upgrades
This commit is contained in:
@@ -89,6 +89,7 @@ export const publicProcedure = t.procedure;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const withLogging = t.middleware(loggingMiddleware as any);
|
||||
const isE2eTestMode = process.env["E2E_TEST_MODE"] === "true";
|
||||
|
||||
/**
|
||||
* Protected procedure — requires authenticated session AND a valid DB user record.
|
||||
@@ -103,12 +104,14 @@ export const protectedProcedure = t.procedure.use(withLogging).use(({ ctx, next
|
||||
}
|
||||
|
||||
// Rate limit by user ID
|
||||
const rateLimitResult = apiRateLimiter(ctx.dbUser.id);
|
||||
if (!rateLimitResult.allowed) {
|
||||
throw new TRPCError({
|
||||
code: "TOO_MANY_REQUESTS",
|
||||
message: `Rate limit exceeded. Try again after ${rateLimitResult.resetAt.toISOString()}`,
|
||||
});
|
||||
if (!isE2eTestMode) {
|
||||
const rateLimitResult = apiRateLimiter(ctx.dbUser.id);
|
||||
if (!rateLimitResult.allowed) {
|
||||
throw new TRPCError({
|
||||
code: "TOO_MANY_REQUESTS",
|
||||
message: `Rate limit exceeded. Try again after ${rateLimitResult.resetAt.toISOString()}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return next({
|
||||
|
||||
Reference in New Issue
Block a user