Skip to content

Account and Owner Recovery

Recovery has three layers, from least to most privileged.

Available to any account. POST /api/v1/public/password-reset/request emails a single-use link valid for one hour. It needs email configured; without it the request succeeds but the link is only logged.

For “forgot my password and lost my email.” The Owner generates ten single-use codes ahead of time (Profile → Security, with the password re-entered), stores them safely, and can redeem one at POST /api/v1/public/recovery/redeem. Codes are shown once and stored only as hashes.

For an Owner with neither password nor recovery code. Two independent mechanisms operate directly on the database, not through normal sign-in.

For when you have Cloudflare access through Wrangler:

Terminal window
pnpm --filter @kenresoft-cms/api recover-owner:remote

Use recover-owner:local for local development. It looks up the Owner through wrangler d1 execute, prompts for a new password interactively (never as an argument, so it stays out of shell history) and signs that account out everywhere. Pass --email if there is more than one Owner. It needs no standing secret.

POST /api/v1/system/recover-owner with { "secret", "email", "newPassword" }.

  • Disabled by default. It returns 404, indistinguishable from a route that does not exist, until you set the secret: wrangler secret put OWNER_RECOVERY_SECRET.
  • With the secret set, a wrong secret returns 403. It is rate limited (3 per 60 seconds), and the secret comparison is constant-time.
  • On success it replaces the Owner’s password, deletes all of that account’s sessions, and records owner.recovered in the audit log.

Kenresoft holds no secret or back door into any deployment. Every recovery path exists only inside your own deployment.