Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
insert: (tx: PoolClient) =>
PasswordCredential.write(
tx,
{
id: "03e69b4c-3f73-4b15-866c-17efeeed1678",
enabled: true,
authorityId: "725f9c3b-4a72-4021-9066-c89e534df5be",
authorityUserId: "306eabbb-cc2b-4f88-be19-4bb6ec98e5c3",
userId: "306eabbb-cc2b-4f88-be19-4bb6ec98e5c3",
details: {
hash: "$2a$04$bEApeUnCL0pMAZf6fNym9OO/z6SJsyN6CY773Fx1O7ZTSzgwu1pXG" // password: costa rica
}
},
{
recordId: "5cb8a994-5c76-4551-891e-f9720a4be423",
createdByAuthorizationId: "f0e54748-c7bb-4724-ad8b-7dabb66aafa9",
createdAt: new Date("2019-03-06T21:07:59.814Z")
}
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)
]);
}