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:
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.