Skip to main content

Function: checkApplyRateLimit()

checkApplyRateLimit(svc, ip, opts?): Promise<boolean>

Defined in: src/server/services/applyRateLimit.ts:13

Per-IP rate limit for the public /api/apply endpoint, backed by the apply_rate_hit RPC (atomic, distributed — works across serverless instances). Returns true when the request is ALLOWED, false when the IP is over the window limit. Fails OPEN on limiter errors so a limiter hiccup never blocks a legitimate applicant (Turnstile + honeypot remain the primary defenses). IPs are hashed before use.

Parameters

svc

SupabaseClient

ip

string | null

opts?

limit?

number

windowSeconds?

number

Returns

Promise<boolean>