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

Add deactivate account function

This commit is contained in:
David Baker
2016-08-03 15:26:05 +01:00
parent c288e6c7ec
commit 35d45f0280

View File

@@ -128,6 +128,28 @@ MatrixBaseApis.prototype.logout = function(callback) {
);
};
/**
* Deactivates the logged-in account.
* Obviously, further calls that require authorisation should fail after this
* method is called. The state of the MatrixClient object is not affected:
* it is up to the caller to either reset or destroy the MatrixClient after
* this method succeeds.
* @param {object} auth Optional. Auth data to supply for User-Interactive auth.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: On success, the empty object
*/
MatrixBaseApis.prototype.deactivateAccount = function(auth, callback) {
var body = {};
if (auth) {
body = {
auth: auth,
}
}
return this._http.authedRequestWithPrefix(
callback, "POST", '/account/deactivate', undefined, body, httpApi.PREFIX_UNSTABLE
);
};
// Room operations
// ===============