# The Change Password (reset password) i got Error like something went worng

**URL:** <https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163>\
**Category:** Get Help\
**Tags:** reset-password, password-reset, change-password\
**Created:** [May 21, 2021, 1:53pm UTC](https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163 "2021-05-21T13:53:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijayan\_Murugan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vijayan_murugan/32/12814_2.png) [@Vijayan\_Murugan](https://community.auth0.com/u/Vijayan_Murugan)\
**Post date:** [May 21, 2021, 1:53pm UTC](https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163/1 "2021-05-21T13:53:37Z")

</div>

Here I’m configured the custom DB everything working fine but the Password change screen only got an error I have attached the log and screen view for change the password please take a look and help me out.

![change password](https://global.discourse-cdn.com/auth0/original/3X/0/4/04aefef6a127f8995fe411693e7c09f76c23473b.jpeg) ![image1](https://global.discourse-cdn.com/auth0/original/3X/6/3/639e65da3197dbf0a85ed4a15b4da7d48c054182.png)

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 21, 2021, 2:22pm UTC](https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163/3 "2021-05-21T14:22:50Z")

</div>

Hi @Vijayan_Murugan,

Thanks for joining the Community!

Would you private messaging me your tenant name so that I can take a look at your custom DB settings?

Thank you!

Stephanie

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 21, 2021, 6:46pm UTC](https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163/4 "2021-05-21T18:46:33Z")

</div>

Update: @Vijayan_Murugan was able to resolve the script error by using the [Real-time Webtask Logs Extension](https://auth0.com/docs/extensions/real-time-webtask-logs?_ga=2.45354663.2047594292.1621254077-1595415333.1607347674&_gac=1.179845590.1620663261.Cj0KCQjws-OEBhCkARIsAPhOkIbhK13acrxZIWhKyPE4GlpGf7ZKmKpxtmuQbD_VcaLmyScFgvNZcmAaAntFEALw_wcB) extension and loging the result.

The template script provided in the [docs](https://auth0.com/docs/connections/database/custom-db/templates/change-password#mysql) expects the db results to be an array:

```auto
bcrypt.hash(newPassword, 10, function(err, hash) {
    if (err) return callback(err);

    connection.query(query, [hash, email], function(err, results) {
      if (err) return callback(err);
      callback(null, results.length > 0);
    });
  });

```

The script was determining the password change as a failure because `results` is not an array in this case. This was resolved by updating the script to:

```auto
bcrypt.hash(newPassword, 10, function(err, hash) {
    if (err) return callback(err);

    connection.query(query, [hash, email], function(err, results) {
      if (err) return callback(err);
      callback(null, results); // <-- updating this line
    });
  });

```

---

<div class="post-metadata">

**Author:** ![Vijayan\_Murugan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vijayan_murugan/32/12814_2.png) [@Vijayan\_Murugan](https://community.auth0.com/u/Vijayan_Murugan)\
**Post date:** [May 21, 2021, 6:50pm UTC](https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163/5 "2021-05-21T18:50:52Z")

</div>

> [@stephanie.chamblee](#):
>
> `results`

updated line should be like this  
callback(null,results && results.affectedRows\>0);

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 5, 2021, 6:50pm UTC](https://community.auth0.com/t/the-change-password-reset-password-i-got-error-like-something-went-worng/63163/6 "2021-06-05T18:50:56Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
