Merge pull request #5674 from churchtools/default-username

Add url param `defaultUsername` to prefill the login username field
pull/21833/head
J. Ryan Stinnett 2021-06-01 10:12:31 +01:00 committed by GitHub
commit a8b6094482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -2091,6 +2091,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
onForgotPasswordClick={showPasswordReset ? this.onForgotPasswordClick : undefined} onForgotPasswordClick={showPasswordReset ? this.onForgotPasswordClick : undefined}
onServerConfigChange={this.onServerConfigChange} onServerConfigChange={this.onServerConfigChange}
fragmentAfterLogin={fragmentAfterLogin} fragmentAfterLogin={fragmentAfterLogin}
defaultUsername={this.props.startingFragmentQueryParams.defaultUsername}
{...this.getServerProperties()} {...this.getServerProperties()}
/> />
); );

View File

@ -59,6 +59,7 @@ interface IProps {
fallbackHsUrl?: string; fallbackHsUrl?: string;
defaultDeviceDisplayName?: string; defaultDeviceDisplayName?: string;
fragmentAfterLogin?: string; fragmentAfterLogin?: string;
defaultUsername?: string;
// Called when the user has logged in. Params: // Called when the user has logged in. Params:
// - The object returned by the login API // - The object returned by the login API
@ -119,7 +120,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
flows: null, flows: null,
username: "", username: props.defaultUsername? props.defaultUsername: '',
phoneCountry: null, phoneCountry: null,
phoneNumber: "", phoneNumber: "",