All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 1m4s
10 lines
385 B
JavaScript
10 lines
385 B
JavaScript
import { hashPassword } from "../server/auth.js";
|
|
// Read from stdin so passwords never need to appear in shell arguments.
|
|
let input = "";
|
|
for await (const chunk of process.stdin) input += chunk;
|
|
const password = input.trimEnd();
|
|
if (password.length < 12)
|
|
throw new Error(
|
|
"Use at least 12 characters. Pipe the password through stdin.",
|
|
);
|
|
console.log(hashPassword(password));
|