1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Remove id_server from creds for interactive auth

For HSes that do not require an IS, we can remove `id_server` from the auth
params.

Fixes https://github.com/vector-im/riot-web/issues/10959
This commit is contained in:
J. Ryan Stinnett
2019-09-25 14:59:32 +01:00
parent 8b3b181a48
commit 8d667f9367

View File

@@ -174,16 +174,19 @@ InteractiveAuth.prototype = {
// The email can be validated out-of-band, but we need to provide the // The email can be validated out-of-band, but we need to provide the
// creds so the HS can go & check it. // creds so the HS can go & check it.
if (this._emailSid) { if (this._emailSid) {
const creds = {
sid: this._emailSid,
client_secret: this._clientSecret,
};
if (await this._matrixClient.doesServerRequireIdServerParam()) {
const idServerParsedUrl = url.parse( const idServerParsedUrl = url.parse(
this._matrixClient.getIdentityServerUrl(), this._matrixClient.getIdentityServerUrl(),
); );
creds.id_server = idServerParsedUrl.host;
}
authDict = { authDict = {
type: EMAIL_STAGE_TYPE, type: EMAIL_STAGE_TYPE,
threepid_creds: { threepid_creds: creds,
sid: this._emailSid,
client_secret: this._clientSecret,
id_server: idServerParsedUrl.host,
},
}; };
} }
} }