1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Merge pull request #235 from matrix-org/rav/delete_device_ui_auth

Support User-Interactive auth for delete device
This commit is contained in:
David Baker
2016-10-12 18:13:49 +01:00
committed by GitHub
2 changed files with 26 additions and 2 deletions

View File

@@ -749,16 +749,23 @@ MatrixBaseApis.prototype.setDeviceDetails = function(device_id, body) {
* Delete the given device
*
* @param {string} device_id device to delete
* @param {object} auth Optional. Auth data to supply for User-Interactive auth.
* @return {module:client.Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixBaseApis.prototype.deleteDevice = function(device_id) {
MatrixBaseApis.prototype.deleteDevice = function(device_id, auth) {
var path = utils.encodeUri("/devices/$device_id", {
$device_id: device_id,
});
var body = {};
if (auth) {
body.auth = auth;
}
return this._http.authedRequestWithPrefix(
undefined, "DELETE", path, undefined, undefined,
undefined, "DELETE", path, undefined, body,
httpApi.PREFIX_UNSTABLE
);
};