mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
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);
|
||||
|
||||
let desc;
|
||||
if (haveIs) {
|
||||
desc = _t(
|
||||
"If you don't specify an email address, you won't be able to reset your password. " +
|
||||
"Are you sure?",
|
||||
);
|
||||
} else {
|
||||
if (this.props.serverRequiresIdServer && !haveIs) {
|
||||
desc = _t(
|
||||
"No Identity Server is configured so you cannot add add an email address in order to " +
|
||||
"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");
|
||||
|
@ -439,7 +439,10 @@ module.exports = createReactClass({
|
|||
|
||||
_showEmail() {
|
||||
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 true;
|
||||
|
@ -448,8 +451,11 @@ module.exports = createReactClass({
|
|||
_showPhoneNumber() {
|
||||
const threePidLogin = !SdkConfig.get().disable_3pid_login;
|
||||
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
||||
const haveRequiredIs = this.props.serverRequiresIdServer && !haveIs;
|
||||
if (!threePidLogin || haveRequiredIs || !this._authStepIsUsed('m.login.msisdn')) {
|
||||
if (
|
||||
!threePidLogin ||
|
||||
(this.props.serverRequiresIdServer && !haveIs) ||
|
||||
!this._authStepIsUsed('m.login.msisdn')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -592,12 +598,15 @@ module.exports = createReactClass({
|
|||
}
|
||||
}
|
||||
const haveIs = Boolean(this.props.serverConfig.isUrl);
|
||||
const noIsText = haveIs ? null : <div>
|
||||
let noIsText = null;
|
||||
if (this.props.serverRequiresIdServer && !haveIs) {
|
||||
noIsText = <div>
|
||||
{_t(
|
||||
"No Identity Server is configured: no email addreses can be added. " +
|
||||
"You will be unable to reset your password.",
|
||||
)}
|
||||
</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
Loading…
Reference in a new issue