Merge pull request #2340 from matrix-org/rav/no_preserve_hs_url

Avoid preserving HS url at logout
pull/21833/head
Bruno Windels 2018-12-11 16:40:46 +00:00 committed by GitHub
commit 566e03568e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 13 deletions

View File

@ -497,16 +497,7 @@ function _clearStorage() {
Analytics.logout(); Analytics.logout();
if (window.localStorage) { if (window.localStorage) {
const hsUrl = window.localStorage.getItem("mx_hs_url");
const isUrl = window.localStorage.getItem("mx_is_url");
window.localStorage.clear(); window.localStorage.clear();
// preserve our HS & IS URLs for convenience
// N.B. we cache them in hsUrl/isUrl and can't really inline them
// as getCurrentHsUrl() may call through to localStorage.
// NB. We do clear the device ID (as well as all the settings)
if (hsUrl) window.localStorage.setItem("mx_hs_url", hsUrl);
if (isUrl) window.localStorage.setItem("mx_is_url", isUrl);
} }
// create a temporary client to clear out the persistent stores. // create a temporary client to clear out the persistent stores.

View File

@ -204,8 +204,6 @@ export default React.createClass({
return this.state.register_hs_url; return this.state.register_hs_url;
} else if (MatrixClientPeg.get()) { } else if (MatrixClientPeg.get()) {
return MatrixClientPeg.get().getHomeserverUrl(); return MatrixClientPeg.get().getHomeserverUrl();
} else if (window.localStorage && window.localStorage.getItem("mx_hs_url")) {
return window.localStorage.getItem("mx_hs_url");
} else { } else {
return this.getDefaultHsUrl(); return this.getDefaultHsUrl();
} }
@ -224,8 +222,6 @@ export default React.createClass({
return this.state.register_is_url; return this.state.register_is_url;
} else if (MatrixClientPeg.get()) { } else if (MatrixClientPeg.get()) {
return MatrixClientPeg.get().getIdentityServerUrl(); return MatrixClientPeg.get().getIdentityServerUrl();
} else if (window.localStorage && window.localStorage.getItem("mx_is_url")) {
return window.localStorage.getItem("mx_is_url");
} else { } else {
return this.getDefaultIsUrl(); return this.getDefaultIsUrl();
} }