Hashes and checks passwords, for sign-up, sign-in, password changes and the
admin that db/startup.ts seeds. It reads no config, so the startup tasks
can use it before the server's settings are checked.
f
hashPassword(password: string): Promise<string>
Hashes password with scrypt and a random salt, as hash.salt in hex, for
users.password_hash.
f
verifyPassword(): Promise<boolean>
password: string,
storedHash: string
Checks password against a hash made by hashPassword.
Usage
import * as mod from "api/lib/password.ts";