don't try to get id server domain when not asked to bind
parent
c97d1d5b05
commit
48b8044937
|
@ -20,6 +20,10 @@ import MatrixClientPeg from './MatrixClientPeg';
|
||||||
import { _t } from './languageHandler';
|
import { _t } from './languageHandler';
|
||||||
import IdentityAuthClient from './IdentityAuthClient';
|
import IdentityAuthClient from './IdentityAuthClient';
|
||||||
|
|
||||||
|
function getIdServerDomain() {
|
||||||
|
return MatrixClientPeg.get().idBaseUrl.split("://")[1];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows a user to add a third party identifier to their homeserver and,
|
* Allows a user to add a third party identifier to their homeserver and,
|
||||||
* optionally, the identity servers.
|
* optionally, the identity servers.
|
||||||
|
@ -155,7 +159,6 @@ export default class AddThreepid {
|
||||||
* the request failed.
|
* the request failed.
|
||||||
*/
|
*/
|
||||||
async checkEmailLinkClicked() {
|
async checkEmailLinkClicked() {
|
||||||
const identityServerDomain = MatrixClientPeg.get().idBaseUrl.split("://")[1];
|
|
||||||
try {
|
try {
|
||||||
if (await MatrixClientPeg.get().doesServerSupportSeparateAddAndBind()) {
|
if (await MatrixClientPeg.get().doesServerSupportSeparateAddAndBind()) {
|
||||||
if (this.bind) {
|
if (this.bind) {
|
||||||
|
@ -164,7 +167,7 @@ export default class AddThreepid {
|
||||||
await MatrixClientPeg.get().bindThreePid({
|
await MatrixClientPeg.get().bindThreePid({
|
||||||
sid: this.sessionId,
|
sid: this.sessionId,
|
||||||
client_secret: this.clientSecret,
|
client_secret: this.clientSecret,
|
||||||
id_server: identityServerDomain,
|
id_server: getIdServerDomain(),
|
||||||
id_access_token: identityAccessToken,
|
id_access_token: identityAccessToken,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -177,7 +180,7 @@ export default class AddThreepid {
|
||||||
await MatrixClientPeg.get().addThreePid({
|
await MatrixClientPeg.get().addThreePid({
|
||||||
sid: this.sessionId,
|
sid: this.sessionId,
|
||||||
client_secret: this.clientSecret,
|
client_secret: this.clientSecret,
|
||||||
id_server: identityServerDomain,
|
id_server: getIdServerDomain(),
|
||||||
}, this.bind);
|
}, this.bind);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue