Created
November 24, 2016 04:23
-
-
Save arcseldon/ba5bfb8caa92df3c52e33b903a0a55cf to your computer and use it in GitHub Desktop.
Custom DB change password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this didn't work