[next] Start a clean session when user logs in / out (#1853)

* Clear user session after login / logout

* Filename cases

* Improve type checking

* Apply suggestions
This commit is contained in:
Kiwi
2018-09-12 16:04:54 +00:00
committed by Wyatt Johnson
parent 26b59fc17c
commit 8b09b52be8
30 changed files with 485 additions and 331 deletions
@@ -38,15 +38,12 @@ export const render = ({
};
const StreamQuery: StatelessComponent<InnerProps> = ({
local: { assetID, authRevision },
local: { assetID },
}) => (
<QueryRenderer<QueryTypes>
query={graphql`
query StreamQuery($assetID: ID!, $authRevision: Int!) {
# authRevision is increment every time auth state has changed.
# This is basically a cache invalidation and causes relay
# to automatically update this query.
me(clientAuthRevision: $authRevision) {
query StreamQuery($assetID: ID!) {
me {
...StreamContainer_me
}
asset(id: $assetID) {
@@ -56,7 +53,6 @@ const StreamQuery: StatelessComponent<InnerProps> = ({
`}
variables={{
assetID: assetID!,
authRevision,
}}
render={render}
/>
@@ -66,7 +62,6 @@ const enhanced = withLocalStateContainer(
graphql`
fragment StreamQueryLocal on Local {
assetID
authRevision
}
`
)(StreamQuery);