Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5674 from churchtools/default-username
Browse files Browse the repository at this point in the history
Add url param `defaultUsername` to prefill the login username field
  • Loading branch information
jryans authored Jun 1, 2021
2 parents 30e136d + 5c67436 commit a8b6094
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
onForgotPasswordClick={showPasswordReset ? this.onForgotPasswordClick : undefined}
onServerConfigChange={this.onServerConfigChange}
fragmentAfterLogin={fragmentAfterLogin}
defaultUsername={this.props.startingFragmentQueryParams.defaultUsername}
{...this.getServerProperties()}
/>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/structures/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface IProps {
fallbackHsUrl?: string;
defaultDeviceDisplayName?: string;
fragmentAfterLogin?: string;
defaultUsername?: string;

// Called when the user has logged in. Params:
// - The object returned by the login API
Expand Down Expand Up @@ -119,7 +120,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>

flows: null,

username: "",
username: props.defaultUsername? props.defaultUsername: '',
phoneCountry: null,
phoneNumber: "",

Expand Down

0 comments on commit a8b6094

Please sign in to comment.