auth/account_routes.ts view source
AccountRouteOptions import type {AccountRouteOptions} from '@fuzdev/fuz_app/auth/account_routes.js'; Per-factory configuration for account route specs.
inheritance
login_ip_rate_limiter
Rate limiter for login + password-change attempts, keyed by client IP.
Pass null to disable. The distributed-spray backstop: login is the one
surface that guesses *other* accounts' credentials, so this bucket is
never refunded on success (see RateLimiter.reset). Password change
shares it — it is password-bearing on the same account grain, and the
Rust spine shares the same instance across both.
type RateLimiter | null
login_account_rate_limiter
Rate limiter for login attempts, keyed by submitted username. Pass null to disable.
type RateLimiter | null
max_sessions?
Max active sessions per account. Evicts oldest on login. Default 5, null disables.
type number | null
login_fail_floor_ms?
Minimum wall-clock time (ms) for login 401 responses. Set to 0 or a
negative number to disable (e.g., in tests). Default
DEFAULT_LOGIN_FAIL_FLOOR_MS.
type number
login_fail_jitter_ms?
Uniform jitter window (±ms) layered on the floor. Set to 0 to disable
jitter while keeping the floor. Default DEFAULT_LOGIN_FAIL_JITTER_MS.
type number
connection_closer?
Live-connection closer — when set, the logout and password handlers
eagerly close affected WebSocket sockets for the account BEFORE
emitting the corresponding audit event. Mirrors the self-service
action surface (see AccountActionOptions.connection_closer). When
absent, only the listener-based close (transports_ws_auth_guard
registered via audit.add_listener) runs.
type ConnectionCloser | null
bootstrap_status?
Runtime bootstrap status for the bundled GET /status route — when
available, its unauthenticated 401 carries bootstrap_available: true
so a fresh frontend can route to the bootstrap flow. Pass
ctx.bootstrap_status (the live BootstrapStatus ref) so the flag tracks
the one-shot bootstrap completing. Omit when no bootstrap flow is wired —
/status is still served, just without the flag.
type { available: boolean }