diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js
index b9eaa3efa3..2d56df6be4 100644
--- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js
@@ -70,7 +70,16 @@ export default class GeneralUserSettingsTab extends React.Component {
const cli = MatrixClientPeg.get();
const serverSupportsSeparateAddAndBind = await cli.doesServerSupportSeparateAddAndBind();
- this.setState({serverSupportsSeparateAddAndBind});
+
+ const capabilities = await cli.getCapabilities(); // this is cached
+ const changePasswordCap = capabilities['m.change_password'];
+
+ // You can change your password so long as the capability isn't explicitly disabled. The implicit
+ // behaviour is you can change your password when the capability is missing or has not-false as
+ // the enabled flag value.
+ const canChangePassword = !changePasswordCap || changePasswordCap['enabled'] !== false;
+
+ this.setState({serverSupportsSeparateAddAndBind, canChangePassword});
this._getThreepidState();
}
@@ -280,7 +289,7 @@ export default class GeneralUserSettingsTab extends React.Component {
const PhoneNumbers = sdk.getComponent("views.settings.account.PhoneNumbers");
const Spinner = sdk.getComponent("views.elements.Spinner");
- const passwordChangeForm = (
+ let passwordChangeForm = (
- {_t("Set a new account password...")} + {passwordChangeText}
{passwordChangeForm} {threepidSection} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index c86640132a..099b64dd49 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -665,8 +665,8 @@ "Profile": "Profile", "Email addresses": "Email addresses", "Phone numbers": "Phone numbers", - "Account": "Account", "Set a new account password...": "Set a new account password...", + "Account": "Account", "Language and region": "Language and region", "Theme": "Theme", "Agree to the identity server (%(serverName)s) Terms of Service to allow yourself to be discoverable by email address or phone number.": "Agree to the identity server (%(serverName)s) Terms of Service to allow yourself to be discoverable by email address or phone number.",