Reset store state when logging out

This prevents leaking of state that we do not want to share with the next user
pull/21833/head
Luke Barnard 2017-05-25 17:16:16 +01:00
parent 0849b0e205
commit 263a51938d
3 changed files with 13 additions and 0 deletions

View File

@ -61,6 +61,11 @@ class LifecycleStore extends Store {
});
dis.dispatch(deferredAction);
break;
case 'on_logged_out':
this._state = {
deferred_action: null,
};
break;
}
}
}

View File

@ -73,6 +73,9 @@ class RoomViewStore extends Store {
case 'join_room':
this._joinRoom(payload);
break;
case 'on_logged_out':
this.reset();
break;
}
}

View File

@ -66,6 +66,11 @@ class SessionStore extends Store {
cachedPassword: null,
});
break;
case 'on_logged_out':
this._state = {
cachedPassword: null,
};
break;
}
}