diff options
| author | Wes Bos <wesbos@gmail.com> | 2017-08-25 09:33:53 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2017-08-25 09:33:53 -0400 |
| commit | 7af74ff8988961c988f03c95961b70c2918521ae (patch) | |
| tree | d73cd0dd94751b76595b7febcae4162811c2040b /.next/dist/lib | |
| parent | 416c2cbae0e69b724876d232bf813eefd7550174 (diff) | |
yay
Diffstat (limited to '.next/dist/lib')
| -rw-r--r-- | .next/dist/lib/image.js | 13 | ||||
| -rw-r--r-- | .next/dist/lib/initApollo.js | 30 |
2 files changed, 37 insertions, 6 deletions
diff --git a/.next/dist/lib/image.js b/.next/dist/lib/image.js new file mode 100644 index 0000000..53e68cd --- /dev/null +++ b/.next/dist/lib/image.js @@ -0,0 +1,13 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (image) { + var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; + var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300; + + if (!image || !image.secret) return ''; + return 'https://images.graph.cool/v1/cj5xz8szs28930145gct82bdj/' + image.secret + '/' + width + 'x' + height; +};
\ No newline at end of file diff --git a/.next/dist/lib/initApollo.js b/.next/dist/lib/initApollo.js index 99eaf8f..da093d8 100644 --- a/.next/dist/lib/initApollo.js +++ b/.next/dist/lib/initApollo.js @@ -21,15 +21,33 @@ if (!process.browser) { } function create(initialState) { + + var networkInterface = (0, _reactApollo.createNetworkInterface)({ + uri: 'https://api.graph.cool/simple/v1/cj5xz8szs28930145gct82bdj', // Server URL (must be absolute) + opts: { // Additional fetch() options like `credentials` or `headers` + credentials: 'same-origin' + } + }); + + // use the auth0IdToken in localStorage for authorized requests + networkInterface.use([{ + applyMiddleware: function applyMiddleware(req, next) { + if (!req.options.headers) { + req.options.headers = {}; + } + + // get the authentication token from local storage if it exists + if (typeof localStorage !== 'undefined' && localStorage.getItem("auth0IdToken")) { + req.options.headers.authorization = 'Bearer ' + localStorage.getItem("auth0IdToken"); + } + next(); + } + }]); + return new _reactApollo.ApolloClient({ initialState: initialState, ssrMode: !process.browser, // Disables forceFetch on the server (so queries are only run once) - networkInterface: (0, _reactApollo.createNetworkInterface)({ - uri: 'https://api.graph.cool/simple/v1/cj5xz8szs28930145gct82bdj', // Server URL (must be absolute) - opts: { // Additional fetch() options like `credentials` or `headers` - credentials: 'same-origin' - } - }) + networkInterface: networkInterface }); } |
