summaryrefslogtreecommitdiffstats
path: root/frontend/components
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/components')
-rw-r--r--frontend/components/Nav.js10
-rw-r--r--frontend/components/Signin.js2
-rw-r--r--frontend/components/Signup.js1
3 files changed, 9 insertions, 4 deletions
diff --git a/frontend/components/Nav.js b/frontend/components/Nav.js
index a90568c..4bbce2d 100644
--- a/frontend/components/Nav.js
+++ b/frontend/components/Nav.js
@@ -4,14 +4,18 @@ import { Query, ApolloConsumer } from 'react-apollo';
import { CURRENT_USER_QUERY } from '../queries/queries.graphql';
import CartCount from './CartCount';
import Signout from './Signout';
-
+import Dump from './Dump';
import NavStyles from './styles/NavStyles';
class Nav extends React.Component {
render() {
+ // below we set the fetchPolicy to network only so it forces re-fetch on the server
return (
- <Query query={CURRENT_USER_QUERY}>
- {({ data: { me } }) => (
+ <Query
+ query={CURRENT_USER_QUERY}
+ fetchPolicy={process.browser ? 'cache-first' : 'network-only'}
+ >
+ {({ data: { me }, loading, error }) => (
<NavStyles data-test="nav">
<Link href="/items">
<a>Shop</a>
diff --git a/frontend/components/Signin.js b/frontend/components/Signin.js
index 7a4db8c..9e25cf1 100644
--- a/frontend/components/Signin.js
+++ b/frontend/components/Signin.js
@@ -28,7 +28,7 @@ class Signin extends Component {
{client => (
<Mutation mutation={SIGNIN_MUTATION} variables={this.state}>
{(signin, { loading, error }) => (
- <Form onSubmit={e => this.loginUser(e, signin, client)}>
+ <Form method="post" onSubmit={e => this.loginUser(e, signin, client)}>
<Error error={error} />
<fieldset disabled={loading} aria-busy={loading}>
<label htmlFor="email">
diff --git a/frontend/components/Signup.js b/frontend/components/Signup.js
index 22a729f..ef622ed 100644
--- a/frontend/components/Signup.js
+++ b/frontend/components/Signup.js
@@ -23,6 +23,7 @@ class Signup extends Component {
<Mutation mutation={SIGNUP_MUTATION} variables={this.state}>
{(signup, { loading, error }) => (
<Form
+ method="post"
onSubmit={async e => {
e.preventDefault();
const res = await signup();