Merge pull request #1 from Algoteers/feature/integrate-Auth0

Thanks @bearcanrun !
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2018-09-07 08:10:20 +02:00
commit 3a34d97eaa
8 files changed
+2548 -2545

No files matched your search

+2452 -2475
View File
File diff suppressed because it is too large. Load diff
+4 -1
View File
@@ -5,12 +5,15 @@
"dependencies": {
"@material-ui/core": "^3.0.2",
"@material-ui/icons": "^3.0.1",
"apollo-boost": "^0.1.15",
"apollo-cache-inmemory": "^1.2.9",
"apollo-client": "^2.4.1",
"apollo-link": "^1.2.2",
"apollo-link-context": "^1.0.8",
"apollo-link-error": "^1.1.0",
"apollo-link-http": "^1.5.4",
"auth0-lock": "^11.9.0",
"graphql": "^14.0.0",
"graphql-tag": "^2.9.2",
"react": "^16.4.2",
"react-apollo": "^2.1.11",
"react-dom": "^16.4.2",
+20 -7
View File
@@ -1,8 +1,10 @@
import React, { Component } from 'react';
import ApolloClient from 'apollo-boost';
import {ApolloProvider} from 'react-apollo';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloProvider } from 'react-apollo';
import { ApolloLink } from 'apollo-link';
import { HttpLink } from 'apollo-link-http'
import { HttpLink } from 'apollo-link-http';
import { onError } from 'apollo-link-error';
import { setContext } from 'apollo-link-context';
import { Route, BrowserRouter, Switch } from 'react-router-dom'
@@ -23,9 +25,18 @@ import Callback from './components/Callback'
import Auth from './auth/index'
/*
const httpLink = new HttpLink({ uri: 'http://localhost:4000/graphql', changeOrigin: true })
// Apollo Client Setup
const httpLink = new HttpLink({ uri: 'http://localhost:4000/graphql', changeOrigin: true })
const errorLink= onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors)
graphQLErrors.map(({ message, locations, path }) =>
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
),
);
if (networkError) console.log(`[Network error]: ${networkError}`);
})
const authLink = setContext((_, { headers }) => {
// get the authentication token from local storage if it exists
@@ -40,13 +51,15 @@ const authLink = setContext((_, { headers }) => {
})
export const client = new ApolloClient({
link: httpLink
link: ApolloLink.from([errorLink, authLink, httpLink]),
cache: new InMemoryCache()
})
*/
/*
export const client = new ApolloClient({
uri:'http://localhost:4000/graphql'
})
*/
export const auth = new Auth(result => console.log('auth result', result), client);
+7
View File
@@ -0,0 +1,7 @@
export const AUTH_CONFIG = {
api_audience: '<AUTH0_API_AUDIENCE>',
domain: '<AUTH0_API_DOMAIN>',
clientId: '<AUTH0_API_CLIENTID>',
callbackUrl: '<AUTH0_CALLBACK_URL>',
logoutUrl: '<AUTH0_LOGOUT_URL>'
}
+1 -1
View File
@@ -6,7 +6,7 @@ import { validObject, deleteCookie } from './js-helpers'
import { client } from '../App'
import { AUTH_CONFIG } from './Auth0'
import { AUTH_CONFIG } from './Auth0' // create by renaming Auth0.sample.js to Auth0.js and setting vars
console.log(process.env.AUTH0_CLIENTID)
+1 -1
View File
@@ -1,4 +1,4 @@
import {gql} from 'apollo-boost';
import gql from 'graphql-tag';
const getUsersQuery = gql`
{
+3
View File
@@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}
+60 -60
View File
@@ -9,7 +9,7 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "2.1.20",
"mime-types": "~2.1.18",
"negotiator": "0.6.1"
}
},
@@ -23,7 +23,7 @@
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"requires": {
"lodash": "4.17.10"
"lodash": "^4.17.10"
}
},
"bluebird": {
@@ -37,15 +37,15 @@
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "1.0.4",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "1.1.2",
"http-errors": "1.6.3",
"depd": "~1.1.1",
"http-errors": "~1.6.2",
"iconv-lite": "0.4.19",
"on-finished": "2.3.0",
"on-finished": "~2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "1.6.16"
"type-is": "~1.6.15"
}
},
"bson": {
@@ -83,8 +83,8 @@
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
"integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
"requires": {
"object-assign": "4.1.1",
"vary": "1.1.2"
"object-assign": "^4",
"vary": "^1"
}
},
"debug": {
@@ -130,36 +130,36 @@
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
"requires": {
"accepts": "1.3.5",
"accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.2",
"content-disposition": "0.5.2",
"content-type": "1.0.4",
"content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "1.1.2",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "1.1.2",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "2.0.4",
"proxy-addr": "~2.0.3",
"qs": "6.5.1",
"range-parser": "1.2.0",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.1",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "1.4.0",
"type-is": "1.6.16",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "1.1.2"
"vary": "~1.1.2"
}
},
"express-graphql": {
@@ -167,10 +167,10 @@
"resolved": "https://registry.npmjs.org/express-graphql/-/express-graphql-0.6.12.tgz",
"integrity": "sha512-ouLWV0hRw4hnaLtXzzwhdC79ewxKbY2PRvm05mPc/zOH5W5WVCHDQ1SmNxEPBQdUeeSNh29aIqW9zEQkA3kMuA==",
"requires": {
"accepts": "1.3.5",
"content-type": "1.0.4",
"http-errors": "1.6.3",
"raw-body": "2.3.2"
"accepts": "^1.3.0",
"content-type": "^1.0.4",
"http-errors": "^1.3.0",
"raw-body": "^2.3.2"
}
},
"finalhandler": {
@@ -179,12 +179,12 @@
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"statuses": "1.4.0",
"unpipe": "1.0.0"
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
}
},
"forwarded": {
@@ -202,7 +202,7 @@
"resolved": "https://registry.npmjs.org/graphql/-/graphql-14.0.0.tgz",
"integrity": "sha512-HGVcnO6B25YZcSt6ZsH6/N+XkYuPA7yMqJmlJ4JWxWlS4Tr8SHI56R1Ocs8Eor7V7joEZPRXPDH8RRdll1w44Q==",
"requires": {
"iterall": "1.2.2"
"iterall": "^1.2.2"
}
},
"http-errors": {
@@ -210,10 +210,10 @@
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "1.1.2",
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": "1.4.0"
"statuses": ">= 1.4.0 < 2"
}
},
"iconv-lite": {
@@ -281,7 +281,7 @@
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz",
"integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==",
"requires": {
"mime-db": "1.36.0"
"mime-db": "~1.36.0"
}
},
"mongodb": {
@@ -290,7 +290,7 @@
"integrity": "sha512-BGUxo4a/p5KtZpOn6+z6iZXTHfDxKDvibHQap9uMJqQouwoszvTIO/QbVZkaSX3Spny0jtTEeHc0FwfpGbtEzA==",
"requires": {
"mongodb-core": "3.1.3",
"safe-buffer": "5.1.2"
"safe-buffer": "^5.1.2"
},
"dependencies": {
"safe-buffer": {
@@ -305,10 +305,10 @@
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.3.tgz",
"integrity": "sha512-dISiV3zHGJTwZpg0xDhi9zCqFGMhA5kDPByHlcaEp09NSKfzHJ7XQbqVrL7qhki1U9PZHsmRfbFzco+6b1h2wA==",
"requires": {
"bson": "1.1.0",
"require_optional": "1.0.1",
"safe-buffer": "5.1.2",
"saslprep": "1.0.1"
"bson": "^1.1.0",
"require_optional": "^1.0.1",
"safe-buffer": "^5.1.2",
"saslprep": "^1.0.0"
},
"dependencies": {
"bson": {
@@ -329,7 +329,7 @@
"integrity": "sha512-yfQw4lbci12DvQrnc25DmP/g74vjhus5SaCliP5sbbzIIJPpeU1F3xscb4uPX26ygjPkl/NzppS65rILNv20Bg==",
"requires": {
"async": "2.6.1",
"bson": "1.0.9",
"bson": "~1.0.5",
"kareem": "2.2.1",
"lodash.get": "4.4.2",
"mongodb": "3.1.4",
@@ -425,7 +425,7 @@
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
"integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==",
"requires": {
"forwarded": "0.1.2",
"forwarded": "~0.1.2",
"ipaddr.js": "1.8.0"
}
},
@@ -463,7 +463,7 @@
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": "1.4.0"
"statuses": ">= 1.3.1 < 2"
}
},
"setprototypeof": {
@@ -483,8 +483,8 @@
"resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz",
"integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==",
"requires": {
"resolve-from": "2.0.0",
"semver": "5.5.1"
"resolve-from": "^2.0.0",
"semver": "^5.1.0"
}
},
"resolve-from": {
@@ -514,18 +514,18 @@
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
"requires": {
"debug": "2.6.9",
"depd": "1.1.2",
"destroy": "1.0.4",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "1.6.3",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "2.3.0",
"range-parser": "1.2.0",
"statuses": "1.4.0"
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
}
},
"serve-static": {
@@ -533,9 +533,9 @@
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
"requires": {
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"parseurl": "1.3.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.2"
}
},
@@ -560,7 +560,7 @@
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "2.1.20"
"mime-types": "~2.1.18"
}
},
"unpipe": {