How to use the @authx/strategy-password.PasswordAuthority.write function in @authx/strategy-password

To help you get started, we’ve selected a few @authx/strategy-password examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github the-control-group / authx / packages / tools / src / lib / bootstrap.ts View on Github external
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)
  ]);
}
github the-control-group / authx / packages / tools / src / lib / fixture / authority.ts View on Github external
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")
        }