summaryrefslogtreecommitdiffstats
path: root/frontend/pages
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-05-16 12:33:56 -0400
committerWes Bos <wesbos@gmail.com>2018-05-16 12:33:56 -0400
commit7ec0943b5d48eb268d03cfa6321c7d83a0d02883 (patch)
treef15b62a9ff5f03d216c2509e52c575ea81febf49 /frontend/pages
parent18752008f9abd7749f61f8d674f66de2a535c131 (diff)
remove cookie dep
Diffstat (limited to 'frontend/pages')
-rw-r--r--frontend/pages/_app.js13
1 files changed, 0 insertions, 13 deletions
diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js
index b2f67cb..65cc378 100644
--- a/frontend/pages/_app.js
+++ b/frontend/pages/_app.js
@@ -3,27 +3,14 @@ import { ApolloProvider } from 'react-apollo';
import withData from '../lib/withData';
import { CURRENT_USER_QUERY } from '../queries/queries.graphql';
import Page from '../components/Page';
-import cookie from 'cookie';
// Next.js wraps each Page in an <App></App> component. This is handy for when you want to persist anything from page to page, or just access a component that is 1 level higher than each page.
// here we use App from next/app and wrap it with withData so we can get Apollo and SSR
class MyApp extends App {
- // componentDidMount() {
- // if (typeof window !== 'undefined' && !window.__CLIENTLOADED__) {
- // this.props.apollo.query({ query: CURRENT_USER_QUERY, fetchPolicy: 'network-only' });
- // window.__CLIENTLOADED__ = true;
- // }
- // }
static async getInitialProps({ Component, ctx }) {
let pageProps = {};
- if (!process.browser && ctx.req.headers.cookie) {
- // if we are SSR, pass along the cookie to apollo
- const cookies = cookie.parse(ctx.req.headers.cookie);
- pageProps.token = cookies.token;
- }
-
if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx);
}