diff --git a/final/client/src/index.js b/final/client/src/index.js
index 7e69da313..9a58e6c8f 100644
--- a/final/client/src/index.js
+++ b/final/client/src/index.js
@@ -6,6 +6,7 @@ import { InMemoryCache } from 'apollo-cache-inmemory';
import { HttpLink } from 'apollo-link-http';
import { ApolloProvider, useQuery } from '@apollo/react-hooks';
import gql from 'graphql-tag';
+import { navigate } from "@reach/router";
import Pages from './pages';
import Login from './pages/login';
@@ -54,7 +55,11 @@ const IS_LOGGED_IN = gql`
function IsLoggedIn() {
const { data } = useQuery(IS_LOGGED_IN);
- return data.isLoggedIn ? : ;
+ if (data.isLoggedIn) {
+ return ;
+ }
+ navigate(`/`);
+ return ;
}
injectStyles();