Signin methods working with no errors.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { Switch, Route } from "react-router-dom";
|
||||
import { Switch, Route, Redirect } from "react-router-dom";
|
||||
import firebase from "../firebase/firebase.utils";
|
||||
|
||||
import "./App.css";
|
||||
@@ -79,18 +79,17 @@ class App extends React.Component {
|
||||
<Switch>
|
||||
<Route exact path="/" component={LandingPage} />
|
||||
<Route exact path="/unauthorized" component={Unauthorized} />
|
||||
{/* <Route
|
||||
<Route
|
||||
exact
|
||||
path="/signin"
|
||||
render={() =>
|
||||
this.props.currentUser.email != null ? (
|
||||
<Redirect to="/manage" />
|
||||
) : (
|
||||
<SignInContainer />
|
||||
<SignInPage />
|
||||
)
|
||||
}
|
||||
/> */}
|
||||
<Route path="/signin" component={SignInPage} />
|
||||
/>
|
||||
<PrivateRoute
|
||||
isAuthorized={this.props.currentUser.email != null}
|
||||
path="/manage"
|
||||
|
||||
@@ -4,14 +4,13 @@ import { Menu, Icon } from "antd";
|
||||
import "./header.styles.scss";
|
||||
import SignOut from "../sign-out/sign-out.component";
|
||||
|
||||
export default ({ selectedNavItem, navItems }) => {
|
||||
export default ({ landingHeader, selectedNavItem, navItems }) => {
|
||||
const handleClick = e => {
|
||||
console.log("click ", e);
|
||||
// this.setState({
|
||||
// current: e.key
|
||||
// });
|
||||
};
|
||||
|
||||
return (
|
||||
<Menu
|
||||
className="header"
|
||||
@@ -27,10 +26,11 @@ export default ({ selectedNavItem, navItems }) => {
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
))}
|
||||
|
||||
{!landingHeader ? (
|
||||
<Menu.Item>
|
||||
<SignOut />
|
||||
</Menu.Item>
|
||||
) : null}
|
||||
</Menu>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@ const HeaderContainer = ({ landingHeader }) => {
|
||||
const parsedNavItems = JSON.parse(data.masterdata_by_pk.value);
|
||||
return (
|
||||
<Header
|
||||
landingHeader={landingHeader}
|
||||
selectedNavItem={selectedNavItem}
|
||||
navItems={parsedNavItems}
|
||||
/>
|
||||
|
||||
@@ -26,8 +26,14 @@ const authLink = setContext((_, { headers }) => {
|
||||
}
|
||||
});
|
||||
|
||||
const middlewares = [];
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
middlewares.push(apolloLogger);
|
||||
}
|
||||
middlewares.push(authLink.concat(httpLink));
|
||||
|
||||
export const client = new ApolloClient({
|
||||
link: authLink.concat(httpLink),
|
||||
link: ApolloLink.from(middlewares),
|
||||
cache: new InMemoryCache({ addTypename: false }),
|
||||
typeDefs,
|
||||
resolvers
|
||||
|
||||
Reference in New Issue
Block a user