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

Use validated server config for login, registration, and password reset #2941

Merged
merged 12 commits into from
May 10, 2019

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented May 3, 2019

Requires element-hq/element-web#9496 - please review together.

Reviewer: Sorry about the size of this, however to keep the app functional the whole changeset needed to be one giant PR. Note that there's several TODO comments assigned to me - these are planned to be followed up by smaller (more manageable) PRs, however core app functionality is still maintained.

See element-hq/element-web#9290
Fixes element-hq/element-web#8628 (see element-hq/element-web#8628 (comment))
Fixes element-hq/element-web#3629
Fixes element-hq/element-web#9224


The overarching principle of this change is that all 3 pages shouldn't have to handle server configuration in any special way and instead just throw around a configuration object for that. This also makes it possible for the riot-web startup to validate and sanitize the config so that each page doesn't have to do it individually.

The design (look and feel) of this is not yet final, as per the TODO comments. Users should not normally hit the bad UX on develop unless they compile the branch themselves and make use of the new default_server_config config.json option.

turt2live added 10 commits May 3, 2019 11:32
This also causes the components to produce a ValidatedServerConfig for use by other components.
The general idea is that we throw the object around between components so they can pull off the details they care about.
Like registration, the idea is that the object is passed around between components so they can take details they need.
Very similar to password resets and registration, the components pass around a server config for usage by other components. Login is a bit more complicated and needs a few more changes to pull the logic out to a more generic layer.
This way the server config is consistent across login, password reset, and registration. This also brings the code into a more generic place for all 3 duplicated efforts.
@turt2live turt2live force-pushed the travis/guests/block-ui branch from d716745 to 4ada66d Compare May 3, 2019 17:42
@turt2live turt2live requested a review from a team May 3, 2019 22:51
@bwindels bwindels requested review from bwindels and removed request for a team May 7, 2019 08:08
Copy link
Contributor

@bwindels bwindels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/components/views/auth/ServerConfig.js Show resolved Hide resolved
@turt2live turt2live changed the base branch from develop to travis/feature/wellknown2 May 10, 2019 17:21
@turt2live
Copy link
Member Author

Changing the base to travis/feature/wellknown2 so that this can land with further PRs being reviewed against that branch. Will merge the feature branch to develop when it is safe.

@turt2live turt2live merged commit 6a941ac into travis/feature/wellknown2 May 10, 2019
@turt2live turt2live deleted the travis/guests/block-ui branch May 10, 2019 17:21
dbkr added a commit that referenced this pull request Jun 12, 2019
We were ignoring the hs/is from the query parameters so after
clicking the link, the new client tried to use the wrong server.

Broken by #2941
Fixes element-hq/element-web#9659
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants