install token now shown in dashboard until install completes.
This commit is contained in:
18 files changed
+1977
-15
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
|
||||
/**
|
||||
* Cryptographically secure hex string of `bytes` random bytes (i.e.
|
||||
* `bytes * 2` hex characters) — the one generator used for every secret
|
||||
* this app creates on a business's behalf (database password,
|
||||
* `AUTH_SECRET`, `INSTALLATION_TOKEN`, `CRON_SECRET`). Pulled out of
|
||||
* provisioning.ts into its own module so a later rotate/regenerate
|
||||
* action (e.g. re-issuing `INSTALLATION_TOKEN`) reuses this exact
|
||||
* mechanism instead of a second, duplicate one.
|
||||
*/
|
||||
export function randomHex(bytes: number): string {
|
||||
return randomBytes(bytes).toString("hex");
|
||||
}
|
||||
Reference in new issue
Block a user