# Last\_password\_reset don't exist or update

**URL:** <https://community.auth0.com/t/last-password-reset-dont-exist-or-update/182485>\
**Category:** Get Help\
**Tags:** user-password-management, user-management\
**Created:** [February 20, 2025, 11:25am UTC](https://community.auth0.com/t/last-password-reset-dont-exist-or-update/182485 "2025-02-20T11:25:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete.oare](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pete.oare/32/73075_2.png) [@pete.oare](https://community.auth0.com/u/pete.oare)\
**Post date:** [February 20, 2025, 11:25am UTC](https://community.auth0.com/t/last-password-reset-dont-exist-or-update/182485/1 "2025-02-20T11:25:08Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
I’m using a custom script to reset passwords, and as part of this I’m returning the last\_password’\_reset value so this can be used by the Password Expiration

The script I am using is as follows:

```auto
function changePassword(email, newPassword, callback) {
  const request = require('request');

  request.post({
    url: configuration.api_url + '/changepassword?key=' + configuration.api_key,
    json: { username: email, password: newPassword }
  }, function(err, response, body) {
    if (err) return callback(err);
    if (response.statusCode === 401) return callback();
    return callback(null, {"last_password_reset": new Date()});
  });
}

```

Passwords are being reset successfully, however the last\_password\_reset value is not being created/updated on the user identity. This is causing an issue where passwords appear to be expired even though they have already been reset.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [February 20, 2025, 8:05pm UTC](https://community.auth0.com/t/last-password-reset-dont-exist-or-update/182485/3 "2025-02-20T20:05:54Z")

</div>

Hi @pete.oare

Welcome to the Auth0 Community!

Could you please attempt to use `Date.now()` and let me know if that changes the outcome?

Kind Regards,  
Nik

---

<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:** [March 6, 2025, 8:06pm UTC](https://community.auth0.com/t/last-password-reset-dont-exist-or-update/182485/4 "2025-03-06T20:06:06Z")

</div>

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