Built-in protections
Rate limits, lockout, CAPTCHA, the audit log and the other defences every project has from the start.
Rate limits
Limits are kept in your database (sypnia_auth.rate_limits), so they hold however many copies of the engine run.
| Action | Default limit |
|---|---|
| Sign-up | 30 per hour per IP |
| Sign-in links and codes, password recovery | 5 per hour per e-mail, 30 per hour per IP |
| Password sign-in | 30 per 5 minutes per IP and e-mail; after 10 failures, waits that double each time |
| Token refresh | 1 800 per hour per session |
/auth/v1/oauth/token | 600 per minute per client |
Every limit is a project setting. A limited request gets 429 with Retry-After.
CAPTCHA
Set a provider (Cloudflare Turnstile or hCaptcha) and its secret; sign-up, sign-in links and codes, recovery and password sign-in then require captchaToken from your form.
No user enumeration
Sign-in failures, recovery and sign-in links answer the same whether the e-mail exists or not.
The audit log
sypnia_auth.audit_log records sign-ups, sign-ins, failures, refreshes, reuse detections, password and e-mail changes, bans, deletions, token and key creation and revocation, with the actor, the user agent and the time. IP addresses are stored as a network prefix (/24 or /48) plus an HMAC of the full address, enough to spot patterns without keeping who is where. Kept 90 days by default.
And also
- Refresh-token reuse ends the session (Sessions and tokens).
- A password sign-in from a network the person has not used before e-mails them (
new_device), when they already had a session. - Secret keys sent from a browser are refused (
secret_key_in_browser). - Sensitive changes need a recent sign-in or a fresh code.