You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Reset store state when logging out
This prevents leaking of state that we do not want to share with the next user
This commit is contained in:
@@ -61,6 +61,11 @@ class LifecycleStore extends Store {
|
|||||||
});
|
});
|
||||||
dis.dispatch(deferredAction);
|
dis.dispatch(deferredAction);
|
||||||
break;
|
break;
|
||||||
|
case 'on_logged_out':
|
||||||
|
this._state = {
|
||||||
|
deferred_action: null,
|
||||||
|
};
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ class RoomViewStore extends Store {
|
|||||||
case 'join_room':
|
case 'join_room':
|
||||||
this._joinRoom(payload);
|
this._joinRoom(payload);
|
||||||
break;
|
break;
|
||||||
|
case 'on_logged_out':
|
||||||
|
this.reset();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,11 @@ class SessionStore extends Store {
|
|||||||
cachedPassword: null,
|
cachedPassword: null,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'on_logged_out':
|
||||||
|
this._state = {
|
||||||
|
cachedPassword: null,
|
||||||
|
};
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user