Using argon2 in custom database

I’m new to auth0 and node.js. I wanted integrate auth0 with custom database and use argon2 encryption package for storing passwords. I was able add this but getting error while signup and log says object null is not iterable (cannot read property Symbol(Symbol.iterator))

But the data is getting inserted into the database.

Here is the signup snippet:

function create(user, callback) {
  const argon2 = require('argon2');
  const postgres = require('pg');

  const conString = configuration.db_uri;
  postgres.connect(conString, function (err, client, done) {
    if (err) return callback(err);

    argon2.hash(user.password).then(hashpassword => {
      const query = 'INSERT INTO users(username, email, password) VALUES ($1, $2, $3)';
      client.query(query, [user.username, user.email, hashpassword], function (err, result) {
        done();
        return callback();
      });
    });
  });
}

Hi @nannigalaxy,

Welcome to the Auth0 Community!

Would you please DM me your tenant name so I can take a look? Thank you!