Throttles admin token guessing on app/api/admin/**.
Check isLimited()before comparing a presented token: a locked-out IP
gets 429 without its guess being evaluated, so the lockout really stops
guessing instead of only changing the error code on wrong guesses. Record a
failure with isAllowed() only after a mismatch. Session cookies skip the
pre-check: they're HMAC-signed, not guessable, so the owner stays signed in
even if someone else shares their IP.
State is in-memory and per-instance, so on serverless this is best-effort
mitigation rather than a hard guarantee.
Throttles admin token guessing on
app/api/admin/**.Check
isLimited()before comparing a presented token: a locked-out IP gets 429 without its guess being evaluated, so the lockout really stops guessing instead of only changing the error code on wrong guesses. Record a failure withisAllowed()only after a mismatch. Session cookies skip the pre-check: they're HMAC-signed, not guessable, so the owner stays signed in even if someone else shares their IP.State is in-memory and per-instance, so on serverless this is best-effort mitigation rather than a hard guarantee.