ThreadCount Community edition
Release / release (push) Has been skipped

Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from 9776046 on 2026-09-16. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
ThreadCount committed 2026-09-17 04:35:27 +10:00
commit 0e18f3ba68
473 files changed
+58690

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
/* Print the current six-digit code for a base32 TOTP secret.
*
* TOTP_SECRET=JBSWY3DPEHPK3PXP npx tsx scripts/totp-code.ts
*
* For the end-to-end suites, which enrol a second factor through the real routes and then need a
* live code to sign in with. The secret comes from the environment, never an argument — argv is
* visible to every process on the box. Uses the product's own implementation (lib/totp.ts), which
* scripts/check-totp.ts proves against RFC 6238's published vectors.
*/
import { base32Decode, totp } from "../lib/totp";
const secret = process.env.TOTP_SECRET || "";
if (!secret) { console.error("TOTP_SECRET must be set in the environment"); process.exit(1); }
process.stdout.write(totp(base32Decode(secret)) + "\n");