Database auth is fully fixed and functional except for outbound firebase.

This commit is contained in:
Patrick Fic
2019-12-06 12:05:33 -08:00
parent ab1e4d5424
commit 78c43fa1e5
58 changed files with 8435 additions and 140 deletions

View File

@@ -3,6 +3,7 @@ import { ApolloProvider } from "react-apollo";
import { HttpLink } from "apollo-link-http";
import ApolloClient from "apollo-client";
import { InMemoryCache } from "apollo-cache-inmemory";
import { resolvers, typeDefs } from "../graphql/resolvers";
//Styling imports
import "./App.css";
@@ -18,22 +19,18 @@ const graphqlEndpoint =
"https://bodyshop-dev-db.herokuapp.com/v1/graphql";
export default function App({ authState }) {
console.log("graphqlEndpoint", graphqlEndpoint);
const isIn = authState.status === "in";
const headers = isIn ? { Authorization: `Bearer ${authState.token}` } : {};
const httpLink = new HttpLink({
uri: graphqlEndpoint,
headers
});
const client = new ApolloClient({
link: httpLink,
cache: new InMemoryCache()
cache: new InMemoryCache(),
resolvers,
typeDefs
});
client.writeData({
data: initialState
});
@@ -41,7 +38,7 @@ export default function App({ authState }) {
return (
<ApolloProvider client={client}>
<HeaderAppBarContainer />
<SignIn />
{isIn ? null : <SignIn />}
<JobListContainer />
</ApolloProvider>
);