You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Add deactivate account function
This commit is contained in:
@@ -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
|
// Room operations
|
||||||
// ===============
|
// ===============
|
||||||
|
|||||||
Reference in New Issue
Block a user