Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tx.query("INSERT INTO authx.authority (id) VALUES ($1)", [
authority.data.id
]),
tx.query("INSERT INTO authx.credential (id) VALUES ($1)", [
credential.data.id
]),
tx.query("INSERT INTO authx.role (id) VALUES ($1)", [role.data.id]),
tx.query("INSERT INTO authx.authorization (id) VALUES ($1)", [
authorization.data.id
])
]);
// insert the records
await Promise.all([
User.write(tx, user.data, user.metadata),
PasswordAuthority.write(tx, authority.data, authority.metadata),
PasswordCredential.write(tx, credential.data, credential.metadata),
Role.write(tx, role.data, role.metadata),
Authorization.write(tx, authorization.data, authorization.metadata)
]);
}
insert: (tx: PoolClient) =>
PasswordAuthority.write(
tx,
{
id: "725f9c3b-4a72-4021-9066-c89e534df5be",
enabled: true,
name: "Password",
description: "The password authority.",
strategy: "password",
details: {
rounds: 4
}
},
{
recordId: "dc4f3328-34da-4c46-94a8-2ec041d495e3",
createdByAuthorizationId: "f0e54748-c7bb-4724-ad8b-7dabb66aafa9",
createdAt: new Date("2019-03-06T21:07:59.814Z")
}