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

Bring back lost functionality on login/register/password-reset screens #200

Merged
merged 5 commits into from
Mar 15, 2016

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Mar 6, 2016

specifically:

  1. custom HS/IS urls are now persisted in HTML5 local storage. As a result, all the login components now distinguish between default HS/IS URLs and custom specified ones again. (
  2. custom HS/IS urls are synchronised between the instances of ServerConfig found in the Login, Registration and Forgot Password screens.
  3. username are persisted over changing homeserver (but not password, to stop accidentally leaking passwords to the wrong server)
  4. correctly interpret a blank URL field as meaning the placeholder text
  5. when toggling custom URLs on and off, remember what the custom values were, and use the default URLs if custom mode is not engaged

also, guest access now upholds custom HS/IS URLs found in local storage rather than being limited to the server config ()

also adds assorted comments and improved console debug and a few minor cosmetic changes to the login components.

… in @kegsay's refactor. specifically:

1) custom HS/IS urls are now persisted in HTML5 local storage.  As a result, all the login components now distinguish between default HS/IS URLs and custom specified ones again. (
2) custom HS/IS urls are synchronised between the instances of ServerConfig found in the Login, Registration and Forgot Password screens.
3) username are persisted over changing homeserver (but not password, to stop accidentally leaking passwords to the wrong server)
4) correctly interpret a blank URL field as meaning the placeholder text
5) when toggling custom URLs on and off, remember what the custom values were, and use the default URLs if custom mode is not engaged

also, guest access now upholds custom HS/IS URLs found in local storage rather than being limited to the server config ()

also adds assorted comments and improved console debug and a few minor cosmetic changes to the login components.

this commit sponsored by VS27...
@@ -115,7 +118,7 @@ class MatrixClient {
}
} else {
console.warn("No local storage available: can't persist HS/IS URLs!");
}
}
Copy link
Member

Choose a reason for hiding this comment

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

A wild space monster appears !

@ara4n
Copy link
Member Author

ara4n commented Mar 15, 2016

@kegsay ptal...

@ara4n ara4n assigned kegsay and unassigned ara4n Mar 15, 2016
}
},

onHomeserverChanged: function(ev) {
this.setState({hs_url: ev.target.value}, function() {
this._hsTimeoutId = this._waitThenInvoke(this._hsTimeoutId, function() {
this.props.onHsUrlChanged(this.state.hs_url.replace(/\/$/, ""));
var hsUrl = this.state.hs_url.trim().replace(/\/$/, "");
Copy link
Member

Choose a reason for hiding this comment

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

If customHsUrl is null, then this.state.hs_url will be null, meaning this will NPE. We should have default props for the custom URLs, or mark isRequired so when the inevitable happens we have an idea why.

@kegsay
Copy link
Member

kegsay commented Mar 15, 2016

LGTM aside from NPE risk.

ara4n added a commit that referenced this pull request Mar 15, 2016
Bring back lost functionality on login/register/password-reset screens
@ara4n ara4n merged commit 672a5cb into develop Mar 15, 2016
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