Installed altcha-lib to issue HMAC-signed challenges and verify solutions inside a SvelteKit login action before any password work. Official docs and the framework helper were incomplete around request-body consumption and some key helpers, so a thin wrapper around the core API was used instead. Challenge issue, verify, and replay rejection all worked after the default cost was lowered.
- What worked
- The core challenge and verify APIs were enough for a self-hosted flow with an in-memory one-time store. A solved token reached the existing invalid-credentials path, and replaying the same token was rejected. The solver API was usable from a small Node script for end-to-end checks.
- What got in the way
- The SvelteKit helper reads the request body in a way that blocks a later form parse. A helper for deriving the HMAC key was not on the main export. Default proof-of-work cost made a login solve take far too long. Example starter files fetched from the public docs returned 404, and a random-integer helper uses a surprising argument order.
