Spaces:
Running
Running
Raise idea submission rate limit to 20/hour for testing
Browse files- app/api/ideas/route.ts +1 -1
- components/SubmitForm.tsx +1 -1
app/api/ideas/route.ts
CHANGED
|
@@ -18,7 +18,7 @@ const createIdeaSchema = z.object({
|
|
| 18 |
show_name: z.boolean().optional().default(false),
|
| 19 |
});
|
| 20 |
|
| 21 |
-
const RATE_LIMIT_PER_HOUR =
|
| 22 |
|
| 23 |
async function checkRateLimit(rateKey: string, ipAddress: string): Promise<boolean> {
|
| 24 |
const now = new Date();
|
|
|
|
| 18 |
show_name: z.boolean().optional().default(false),
|
| 19 |
});
|
| 20 |
|
| 21 |
+
const RATE_LIMIT_PER_HOUR = 20;
|
| 22 |
|
| 23 |
async function checkRateLimit(rateKey: string, ipAddress: string): Promise<boolean> {
|
| 24 |
const now = new Date();
|
components/SubmitForm.tsx
CHANGED
|
@@ -152,7 +152,7 @@ export function SubmitForm({ canShowIdentity }: { canShowIdentity: boolean }) {
|
|
| 152 |
"Generate Requirements"
|
| 153 |
)}
|
| 154 |
</button>
|
| 155 |
-
<p className="subtle text-xs">Rate-limited to
|
| 156 |
</div>
|
| 157 |
|
| 158 |
{error ? <p className="rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700">{error}</p> : null}
|
|
|
|
| 152 |
"Generate Requirements"
|
| 153 |
)}
|
| 154 |
</button>
|
| 155 |
+
<p className="subtle text-xs">Rate-limited to 20 submissions/hour per anonymous identity and IP.</p>
|
| 156 |
</div>
|
| 157 |
|
| 158 |
{error ? <p className="rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700">{error}</p> : null}
|