Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async (): Promise => {
const pool = new Pool();
const tx = await pool.connect();
const user = new User({
id: v4(),
enabled: true,
type: "human",
name: "AuthX Root User"
});
const authority = new PasswordAuthority({
id: v4(),
enabled: true,
strategy: "password",
name: "Password",
description: "The password authority.",
details: {
rounds: 12
}
});
const password = randomBytes(16).toString("hex");
const credential = new PasswordCredential({
id: v4(),
enabled: true,
authorityId: authority.id,
authorityUserId: user.id,