[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
@@ -45,19 +45,12 @@ export const render = ({
};
const PermalinkViewQuery: StatelessComponent<InnerProps> = ({
local: { commentID, assetID, authRevision },
local: { commentID, assetID },
}) => (
<QueryRenderer<QueryTypes>
query={graphql`
query PermalinkViewQuery(
$commentID: ID!
$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 PermalinkViewQuery($commentID: ID!, $assetID: ID!) {
me {
...PermalinkViewContainer_me
}
asset(id: $assetID) {
@@ -71,7 +64,6 @@ const PermalinkViewQuery: StatelessComponent<InnerProps> = ({
variables={{
assetID: assetID!,
commentID: commentID!,
authRevision,
}}
render={render}
/>
@@ -81,7 +73,6 @@ const enhanced = withLocalStateContainer(
graphql`
fragment PermalinkViewQueryLocal on Local {
assetID
authRevision
commentID
}
`