Skip to content

Instantly share code, notes, and snippets.

@arcseldon
Created November 24, 2016 04:23
Show Gist options
  • Select an option

  • Save arcseldon/ba5bfb8caa92df3c52e33b903a0a55cf to your computer and use it in GitHub Desktop.

Select an option

Save arcseldon/ba5bfb8caa92df3c52e33b903a0a55cf to your computer and use it in GitHub Desktop.
Custom DB change password
function changePassword(email, newPassword, callback) {
var request = require('request');
// DEBUG ONLY
console.log('@@@ changePassword - start @@@');
console.log('email: ' + email);
console.log('newPassword: ' + newPassword);
var IDP_ENDPOINT = configuration.ENDPOINT_LOCAL + "/api/v1/changepassword";
var options = {
method: 'PUT',
url: IDP_ENDPOINT,
headers: {
'cache-control': 'no-cache',
'content-type': 'application/json'
},
body: {email: email, password: newPassword},
json: true
};
request(options, function (error /*, response, body */) {
if (error) {
throw new Error(error);
}
console.log('@@@ changePassword - end @@@');
// callback(null, body);
return callback();
});
}
@eddo888

eddo888 commented Nov 30, 2016

Copy link
Copy Markdown

this didn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment