- Two-factor authentication (TOTP), optional per user: a user turns it on with
/my/totp-setup(secret andotpauth://link for the QR code) and/my/totp-enable(a code from any authenticator app; returns 10 one-time recovery codes once), and off with/my/totp-disable(a code). Every/auth/login-*then answers{"mfa_required": true, "mfa_token"}instead of tokens, and the new/auth/login-totp(mfa_tokenand a code or recovery code, 5 tries a minute) gives the tokens; users without 2FA log in exactly as before. Newuserscolumnstotp_secret(AES-GCM encrypted, bound to the user),totp_enabled_at,totp_last_step(a code works once) andtotp_recovery(hashed); an admin resets a user with/admin/user-update {"totp_enabled_at": null}. Off for the app untilconfig_totp_encryption_keyis set in.env;config_totp_issuernames the app in the authenticator. Backend only: pages don't show the code step yet.cryptographyis now pinned inrequirements.txt(docs/auth.md). config.pyin standard sections: settings are grouped by area (app, cors, database, postgres, mssql, query, cache, auth, api_key, otp, totp, profile, log_api, schedule, retention, queue, webhook, blob, email, mobile, ai, aws, azure, msgraph, sftp, monitoring, table, permission, column), then the column dicts,# schema(config_postgres) and# api(config_api). Only order and headers changed; every setting keeps its name and value.