You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-16 22:01:54 +03:00
Avoid preserving HS url at logout
When I was talking to Matthew about this the other day, we couldn't think of a good reason why we should preserve the HS URL at logout. It introduces the problem that, if a client is redirected after login as per MSC1730, and then you log out, you'll then get a login screen for the wrong server. So basically there's no reason to have an mx_hs_url/mx_is_url without an access token, and we can remove the stuff which preserves it, and the stuff that attempts to restore it.
This commit is contained in:
@ -497,16 +497,7 @@ function _clearStorage() {
|
||||
Analytics.logout();
|
||||
|
||||
if (window.localStorage) {
|
||||
const hsUrl = window.localStorage.getItem("mx_hs_url");
|
||||
const isUrl = window.localStorage.getItem("mx_is_url");
|
||||
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.
|
||||
|
Reference in New Issue
Block a user