diff --git a/client/src/App.js b/client/src/App.js index 08d9a2fb0..3c17461ba 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -45,8 +45,8 @@ export const MasterApp = () => ( /> } + path='/keys' + render={props => } /> { - // console.log('onDisconnected') -}) - -wsClient.onReconnected(() => { - // console.log('onReconnected') -}) -*/ const httpLink = new HttpLink({ uri: graphqlEndpoint }) -/* -const link = split( - ({ query }) => { - const { kind, operation } = getMainDefinition(query) - return kind === 'OperationDefinition' && operation === 'subscription' - }, - // new WebSocketLink(wsClient), - httpLink -) -*/ - const authRetryLink = onError( ({ graphQLErrors, networkError, operation, forward }) => { if (graphQLErrors) { @@ -96,16 +54,15 @@ const authRetryLink = onError( } ) -const authLink = setContext(async (_, { headers }) => { +const authLink = setContext((_, { headers }) => { // get the authentication token from local storage if it exists - await getItem('access_token').then(token => { - return { - headers: { - ...headers, - Authorization: token ? `Bearer ${token}` : `` - } + const token = localStorage.getItem('access_token') + return { + headers: { + ...headers, + Authorization: token ? `Bearer ${token}` : `` } - }) + } }) const cache = new InMemoryCache().restore(window.__APOLLO_STATE__) diff --git a/client/src/views/header/index.js b/client/src/views/header/index.js index 50fa6e499..b1b8956f4 100644 --- a/client/src/views/header/index.js +++ b/client/src/views/header/index.js @@ -24,7 +24,7 @@ import AALogo from '../../assets/advanced-algos/aa-logo-dark.svg' const AboutLink = props => const UsersLink = props => const TeamsLink = props => -const KeyVaultLink = props => +const KeyVaultLink = props => const DashboardLink = props => const HomeLink = props => @@ -114,6 +114,9 @@ class Header extends Component { + diff --git a/server/src/createRemoteSchema.js b/server/src/createRemoteSchema.js index 518ba6cf0..f131c14d2 100644 --- a/server/src/createRemoteSchema.js +++ b/server/src/createRemoteSchema.js @@ -22,11 +22,10 @@ export const createRemoteSchema = async (uri) => { const http = makeDatabaseServiceLink() const authLink = setContext((request, previousContext) => { - console.log(previousContext.graphqlContext.headers) return ( { headers: { - Authorization: previousContext.graphqlContext.headers.Authorization ? previousContext.graphqlContext.headers.Authorization : '' + Authorization: previousContext.graphqlContext.headers.authorization ? previousContext.graphqlContext.headers.authorization : '' } } )