Last_password_reset don't exist or update

Ready to post? :mag: 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:

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.

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

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