From c9527685422ad9e158773d35622a4cd87b02d20e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 23 Sep 2019 13:36:07 +0100 Subject: [PATCH] Remove IS details from requestToken to HS This removes the IS details (server and access token) from `requestToken` calls to the HS, as long as the HS supports the new separate add and bind mode. In this mode, all of the 3PID validation is handled by the HS, so the IS details are not used. Fixes https://github.com/vector-im/riot-web/issues/10933 --- src/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index f1e547545..c59df9c71 100644 --- a/src/client.js +++ b/src/client.js @@ -3478,7 +3478,9 @@ MatrixClient.prototype.requestPasswordMsisdnToken = function(phoneCountry, phone MatrixClient.prototype._requestTokenFromEndpoint = async function(endpoint, params) { const postParams = Object.assign({}, params); - if (this.idBaseUrl) { + // If the HS supports separate add and bind, then requestToken endpoints + // don't need an IS as they are all validated by the HS directly. + if (!await this.doesServerSupportSeparateAddAndBind() && this.idBaseUrl) { const idServerUrl = url.parse(this.idBaseUrl); if (!idServerUrl.host) { throw new Error("Invalid ID server URL: " + this.idBaseUrl);