Skip to content

Commit

Permalink
Remove id_server from creds for interactive auth
Browse files Browse the repository at this point in the history
For HSes that do not require an IS, we can remove `id_server` from the auth
params.

Fixes element-hq/element-web#10959
  • Loading branch information
jryans committed Sep 25, 2019
1 parent 8b3b181 commit 8d667f9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/interactive-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,19 @@ InteractiveAuth.prototype = {
// The email can be validated out-of-band, but we need to provide the
// creds so the HS can go & check it.
if (this._emailSid) {
const idServerParsedUrl = url.parse(
this._matrixClient.getIdentityServerUrl(),
);
const creds = {
sid: this._emailSid,
client_secret: this._clientSecret,
};
if (await this._matrixClient.doesServerRequireIdServerParam()) {
const idServerParsedUrl = url.parse(
this._matrixClient.getIdentityServerUrl(),
);
creds.id_server = idServerParsedUrl.host;
}
authDict = {
type: EMAIL_STAGE_TYPE,
threepid_creds: {
sid: this._emailSid,
client_secret: this._clientSecret,
id_server: idServerParsedUrl.host,
},
threepid_creds: creds,
};
}
}
Expand Down

0 comments on commit 8d667f9

Please sign in to comment.