This commit is contained in:
Michael Telatynski 2020-11-25 10:39:44 +00:00
parent 1b1c482f9c
commit c4084196d1
5 changed files with 7 additions and 24 deletions

View file

@ -20,7 +20,6 @@ import {MatrixClient} from "matrix-js-sdk/src/client";
import * as sdk from '../../../index'; import * as sdk from '../../../index';
import { _t, _td } from '../../../languageHandler'; import { _t, _td } from '../../../languageHandler';
import SdkConfig from '../../../SdkConfig';
import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; import { messageForResourceLimitError } from '../../../utils/ErrorUtils';
import AutoDiscoveryUtils, {ValidatedServerConfig} from "../../../utils/AutoDiscoveryUtils"; import AutoDiscoveryUtils, {ValidatedServerConfig} from "../../../utils/AutoDiscoveryUtils";
import classNames from "classnames"; import classNames from "classnames";

View file

@ -30,7 +30,6 @@ import PassphraseField from "./PassphraseField";
import CountlyAnalytics from "../../../CountlyAnalytics"; import CountlyAnalytics from "../../../CountlyAnalytics";
import Field from '../elements/Field'; import Field from '../elements/Field';
import RegistrationEmailPromptDialog from '../dialogs/RegistrationEmailPromptDialog'; import RegistrationEmailPromptDialog from '../dialogs/RegistrationEmailPromptDialog';
import QuestionDialog from '../dialogs/QuestionDialog';
enum RegistrationField { enum RegistrationField {
Email = "field_email", Email = "field_email",

View file

@ -189,7 +189,7 @@ export default class ServerPickerDialog extends React.PureComponent<IProps, ISta
{_t("Use your preferred Matrix homeserver if you have one, or host your own.")} {_t("Use your preferred Matrix homeserver if you have one, or host your own.")}
</p> </p>
<AccessibleButton kind="primary" onClick={this.onSubmit}> <AccessibleButton className="mx_ServerPickerDialog_continue" kind="primary" onClick={this.onSubmit}>
{_t("Continue")} {_t("Continue")}
</AccessibleButton> </AccessibleButton>

View file

@ -2324,9 +2324,6 @@
"Add an email to be able to reset your password.": "Add an email to be able to reset your password.", "Add an email to be able to reset your password.": "Add an email to be able to reset your password.",
"Use email or phone to optionally be discoverable by existing contacts.": "Use email or phone to optionally be discoverable by existing contacts.", "Use email or phone to optionally be discoverable by existing contacts.": "Use email or phone to optionally be discoverable by existing contacts.",
"Use email to optionally be discoverable by existing contacts.": "Use email to optionally be discoverable by existing contacts.", "Use email to optionally be discoverable by existing contacts.": "Use email to optionally be discoverable by existing contacts.",
"Enter your custom homeserver URL <a>What does this mean?</a>": "Enter your custom homeserver URL <a>What does this mean?</a>",
"Homeserver URL": "Homeserver URL",
"Other servers": "Other servers",
"Sign in with SSO": "Sign in with SSO", "Sign in with SSO": "Sign in with SSO",
"Couldn't load page": "Couldn't load page", "Couldn't load page": "Couldn't load page",
"You must <a>register</a> to use this functionality": "You must <a>register</a> to use this functionality", "You must <a>register</a> to use this functionality": "You must <a>register</a> to use this functionality",
@ -2515,8 +2512,6 @@
"Registration has been disabled on this homeserver.": "Registration has been disabled on this homeserver.", "Registration has been disabled on this homeserver.": "Registration has been disabled on this homeserver.",
"This server does not support authentication with a phone number.": "This server does not support authentication with a phone number.", "This server does not support authentication with a phone number.": "This server does not support authentication with a phone number.",
"That username already exists, please try another.": "That username already exists, please try another.", "That username already exists, please try another.": "That username already exists, please try another.",
"Host account on": "Host account on",
"Decide where your account is hosted": "Decide where your account is hosted",
"Continue with": "Continue with", "Continue with": "Continue with",
"Or": "Or", "Or": "Or",
"Already have an account? <a>Sign in here</a>": "Already have an account? <a>Sign in here</a>", "Already have an account? <a>Sign in here</a>": "Already have an account? <a>Sign in here</a>",
@ -2526,6 +2521,8 @@
"You can now close this window or <a>log in</a> to your new account.": "You can now close this window or <a>log in</a> to your new account.", "You can now close this window or <a>log in</a> to your new account.": "You can now close this window or <a>log in</a> to your new account.",
"Registration Successful": "Registration Successful", "Registration Successful": "Registration Successful",
"Create account": "Create account", "Create account": "Create account",
"Host account on": "Host account on",
"Decide where your account is hosted": "Decide where your account is hosted",
"Use Recovery Key or Passphrase": "Use Recovery Key or Passphrase", "Use Recovery Key or Passphrase": "Use Recovery Key or Passphrase",
"Use Recovery Key": "Use Recovery Key", "Use Recovery Key": "Use Recovery Key",
"Confirm your identity by verifying this login from one of your other sessions, granting it access to encrypted messages.": "Confirm your identity by verifying this login from one of your other sessions, granting it access to encrypted messages.", "Confirm your identity by verifying this login from one of your other sessions, granting it access to encrypted messages.": "Confirm your identity by verifying this login from one of your other sessions, granting it access to encrypted messages.",

View file

@ -22,24 +22,12 @@ module.exports = async function signup(session, username, password, homeserver)
await session.goto(session.url('/#/register')); await session.goto(session.url('/#/register'));
// change the homeserver by clicking the advanced section // change the homeserver by clicking the advanced section
if (homeserver) { if (homeserver) {
const advancedButton = await session.query('.mx_ServerTypeSelector_type_Advanced'); const changeButton = await session.query('.mx_ServerPicker_change');
await advancedButton.click(); await changeButton.click();
// depending on what HS is configured as the default, the advanced registration const hsInputField = await session.query('.mx_ServerPickerDialog_otherHomeserver');
// goes the HS/IS entry directly (for matrix.org) or takes you to the user/pass entry (not matrix.org).
// To work with both, we look for the "Change" link in the user/pass entry but don't fail when we can't find it
// As this link should be visible immediately, and to not slow down the case where it isn't present,
// pick a lower timeout of 5000ms
try {
const changeHsField = await session.query('.mx_AuthBody_editServerDetails', 5000);
if (changeHsField) {
await changeHsField.click();
}
} catch (err) {}
const hsInputField = await session.query('#mx_ServerConfig_hsUrl');
await session.replaceInputText(hsInputField, homeserver); await session.replaceInputText(hsInputField, homeserver);
const nextButton = await session.query('.mx_Login_submit'); const nextButton = await session.query('.mx_ServerPickerDialog_continue');
// accept homeserver // accept homeserver
await nextButton.click(); await nextButton.click();
} }