Merge pull request #3528 from matrix-org/bwindels/addemailerror
Fix: Unable to verify email address error
This commit is contained in:
commit
051fd0fd92
4 changed files with 26 additions and 10 deletions
|
@ -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) {
|
||||||
|
@ -221,13 +224,12 @@ export default class AddThreepid {
|
||||||
throw result;
|
throw result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const identityServerDomain = MatrixClientPeg.get().idBaseUrl.split("://")[1];
|
|
||||||
if (await MatrixClientPeg.get().doesServerSupportSeparateAddAndBind()) {
|
if (await MatrixClientPeg.get().doesServerSupportSeparateAddAndBind()) {
|
||||||
if (this.bind) {
|
if (this.bind) {
|
||||||
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: await authClient.getAccessToken(),
|
id_access_token: await authClient.getAccessToken(),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -240,7 +242,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,8 +193,14 @@ export default class EmailAddresses extends React.Component {
|
||||||
this.props.onEmailsChange(emails);
|
this.props.onEmailsChange(emails);
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
this.setState({continueDisabled: false});
|
this.setState({continueDisabled: false});
|
||||||
if (err.errcode !== 'M_THREEPID_AUTH_FAILED') {
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
if (err.errcode === 'M_THREEPID_AUTH_FAILED') {
|
||||||
|
Modal.createTrackedDialog("Email hasn't been verified yet", "", ErrorDialog, {
|
||||||
|
title: _t("Your email address hasn't been verified yet"),
|
||||||
|
description: _t("Click the link in the email you received to verify " +
|
||||||
|
"and then click continue again."),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
console.error("Unable to verify email address: " + err);
|
console.error("Unable to verify email address: " + err);
|
||||||
Modal.createTrackedDialog('Unable to verify email address', '', ErrorDialog, {
|
Modal.createTrackedDialog('Unable to verify email address', '', ErrorDialog, {
|
||||||
title: _t("Unable to verify email address."),
|
title: _t("Unable to verify email address."),
|
||||||
|
|
|
@ -171,8 +171,14 @@ export class EmailAddress extends React.Component {
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.setState({ continueDisabled: false });
|
this.setState({ continueDisabled: false });
|
||||||
if (err.errcode !== 'M_THREEPID_AUTH_FAILED') {
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
if (err.errcode === 'M_THREEPID_AUTH_FAILED') {
|
||||||
|
Modal.createTrackedDialog("E-mail hasn't been verified yet", "", ErrorDialog, {
|
||||||
|
title: _t("Your email address hasn't been verified yet"),
|
||||||
|
description: _t("Click the link in the email you received to verify " +
|
||||||
|
"and then click continue again."),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
console.error("Unable to verify email address: " + err);
|
console.error("Unable to verify email address: " + err);
|
||||||
Modal.createTrackedDialog('Unable to verify email address', '', ErrorDialog, {
|
Modal.createTrackedDialog('Unable to verify email address', '', ErrorDialog, {
|
||||||
title: _t("Unable to verify email address."),
|
title: _t("Unable to verify email address."),
|
||||||
|
|
|
@ -740,6 +740,8 @@
|
||||||
"Who can read history?": "Who can read history?",
|
"Who can read history?": "Who can read history?",
|
||||||
"Unable to revoke sharing for email address": "Unable to revoke sharing for email address",
|
"Unable to revoke sharing for email address": "Unable to revoke sharing for email address",
|
||||||
"Unable to share email address": "Unable to share email address",
|
"Unable to share email address": "Unable to share email address",
|
||||||
|
"Your email address hasn't been verified yet": "Your email address hasn't been verified yet",
|
||||||
|
"Click the link in the email you received to verify and then click continue again.": "Click the link in the email you received to verify and then click continue again.",
|
||||||
"Unable to verify email address.": "Unable to verify email address.",
|
"Unable to verify email address.": "Unable to verify email address.",
|
||||||
"Verify the link in your inbox": "Verify the link in your inbox",
|
"Verify the link in your inbox": "Verify the link in your inbox",
|
||||||
"Complete": "Complete",
|
"Complete": "Complete",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue