# Using argon2 in custom database

**URL:** <https://community.auth0.com/t/using-argon2-in-custom-database/85700>\
**Category:** Get Help\
**Tags:** password, signup, custom-database, login, auth0\
**Created:** [June 22, 2022, 10:38am UTC](https://community.auth0.com/t/using-argon2-in-custom-database/85700 "2022-06-22T10:38:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nannigalaxy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nannigalaxy/32/38311_2.png) [@nannigalaxy](https://community.auth0.com/u/nannigalaxy)\
**Post date:** [June 22, 2022, 10:38am UTC](https://community.auth0.com/t/using-argon2-in-custom-database/85700/1 "2022-06-22T10:38:38Z")

</div>

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:

```auto
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();
      });
    });
  });
}

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2022, 5:29pm UTC](https://community.auth0.com/t/using-argon2-in-custom-database/85700/3 "2022-06-28T17:29:20Z")

</div>

Hi @nannigalaxy,

Welcome to the Auth0 Community!

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

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 11, 2023, 12:58pm UTC](https://community.auth0.com/t/using-argon2-in-custom-database/85700/4 "2023-05-11T12:58:56Z")

</div>


