1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Merge pull request #13 from matrix-org/set_password

Implement setPassword API
This commit is contained in:
Kegsay
2015-07-16 09:59:32 +01:00

View File

@@ -806,6 +806,25 @@ MatrixClient.prototype.addThreePid = function(creds, bind, callback) {
); );
}; };
/**
* @param {Object} authDict
* @param {string} newPassword
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.setPassword = function(authDict, newPassword, callback) {
var path = "/account/password";
var data = {
'auth': authDict,
'new_password': newPassword
};
return this._http.authedRequestWithPrefix(
callback, "POST", path, null, data, httpApi.PREFIX_V2_ALPHA
);
};
/** /**
* @param {string} presence * @param {string} presence
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.