You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Merge pull request #1007 from matrix-org/jryans/is-account-info
Add API for checking IS account info
This commit is contained in:
@@ -1889,6 +1889,25 @@ MatrixBaseApis.prototype.lookupThreePid = async function(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get account info from the Identity Server. This is useful as a neutral check
|
||||||
|
* to verify that other APIs are likely to approve access by testing that the
|
||||||
|
* token is valid, terms have been agreed, etc.
|
||||||
|
*
|
||||||
|
* @param {string} identityAccessToken The `access_token` field of the Identity
|
||||||
|
* Server `/account/register` response (see {@link registerWithIdentityServer}).
|
||||||
|
*
|
||||||
|
* @return {module:client.Promise} Resolves: an object with account info.
|
||||||
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
|
*/
|
||||||
|
MatrixBaseApis.prototype.getIdentityAccount = function(
|
||||||
|
identityAccessToken,
|
||||||
|
) {
|
||||||
|
return this._http.idServerRequest(
|
||||||
|
undefined, "GET", "/account",
|
||||||
|
undefined, httpApi.PREFIX_IDENTITY_V2, identityAccessToken,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
// Direct-to-device messaging
|
// Direct-to-device messaging
|
||||||
// ==========================
|
// ==========================
|
||||||
|
|||||||
Reference in New Issue
Block a user