Remove messages implying you need an identity server for email recovery
This tweaks logic that shows some warning messages saying you need an identity server for email recovery. Assuming you have a modern homeserver, no identity server is need for these activities, so the warnings were confusing. Fixes https://github.com/vector-im/riot-web/issues/11100
This commit is contained in:
parent
a0aef67793
commit
88d0ae0572
1 changed files with 24 additions and 15 deletions
|
@ -97,16 +97,16 @@ module.exports = createReactClass({
|
||||||
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
||||||
|
|
||||||
let desc;
|
let desc;
|
||||||
if (haveIs) {
|
if (this.props.serverRequiresIdServer && !haveIs) {
|
||||||
desc = _t(
|
|
||||||
"If you don't specify an email address, you won't be able to reset your password. " +
|
|
||||||
"Are you sure?",
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
desc = _t(
|
desc = _t(
|
||||||
"No Identity Server is configured so you cannot add add an email address in order to " +
|
"No Identity Server is configured so you cannot add add an email address in order to " +
|
||||||
"reset your password in the future.",
|
"reset your password in the future.",
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
desc = _t(
|
||||||
|
"If you don't specify an email address, you won't be able to reset your password. " +
|
||||||
|
"Are you sure?",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
@ -439,7 +439,10 @@ module.exports = createReactClass({
|
||||||
|
|
||||||
_showEmail() {
|
_showEmail() {
|
||||||
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
||||||
if ((this.props.serverRequiresIdServer && !haveIs) || !this._authStepIsUsed('m.login.email.identity')) {
|
if (
|
||||||
|
(this.props.serverRequiresIdServer && !haveIs) ||
|
||||||
|
!this._authStepIsUsed('m.login.email.identity')
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -448,8 +451,11 @@ module.exports = createReactClass({
|
||||||
_showPhoneNumber() {
|
_showPhoneNumber() {
|
||||||
const threePidLogin = !SdkConfig.get().disable_3pid_login;
|
const threePidLogin = !SdkConfig.get().disable_3pid_login;
|
||||||
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
||||||
const haveRequiredIs = this.props.serverRequiresIdServer && !haveIs;
|
if (
|
||||||
if (!threePidLogin || haveRequiredIs || !this._authStepIsUsed('m.login.msisdn')) {
|
!threePidLogin ||
|
||||||
|
(this.props.serverRequiresIdServer && !haveIs) ||
|
||||||
|
!this._authStepIsUsed('m.login.msisdn')
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -592,12 +598,15 @@ module.exports = createReactClass({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
||||||
const noIsText = haveIs ? null : <div>
|
let noIsText = null;
|
||||||
{_t(
|
if (this.props.serverRequiresIdServer && !haveIs) {
|
||||||
"No Identity Server is configured: no email addreses can be added. " +
|
noIsText = <div>
|
||||||
"You will be unable to reset your password.",
|
{_t(
|
||||||
)}
|
"No Identity Server is configured: no email addreses can be added. " +
|
||||||
</div>;
|
"You will be unable to reset your password.",
|
||||||
|
)}
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue