show login boolean in redux store

This commit is contained in:
2023-02-15 08:34:04 +00:00
parent 316e66a96f
commit fc5217daf8
6 changed files with 65 additions and 51 deletions
+4
View File
@@ -14,6 +14,7 @@ import {
setAccountDetails,
setContainerID,
} from "../store/accountDetails/action";
import { setShowReps } from "../store/currentView/action";
import { wrapper } from "../store/store";
import { getSession, useSession, signIn, signOut } from "next-auth/react";
@@ -159,7 +160,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
const showLoginCheck = process.env.SHOWLOGIN || false;
const showMapCheck = process.env.SHOWMAPS || false;
const showReps = process.env.SHOWREPRESENTATIONS || false;
store.dispatch(setShowReps(showReps, showLoginCheck));
console.log("server checks :", showReps, showLoginCheck);
let hasLoginCode = thisSession != null;
console.log("server side has session:", thisSession != null);
+3 -1
View File
@@ -90,9 +90,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
]);
const showReps = process.env.SHOWREPRESENTATIONS || false;
const showLoginCheck = process.env.SHOWLOGIN || false;
store.dispatch(setShowReps(showReps, showLoginCheck));
console.log("env var ", process.env.SHOWREPRESENTATIONS);
store.dispatch(setShowReps(showReps));
store.dispatch(setShowReps(showReps, showLoginCheck));
searchResultsObj =
searchResultsObj.status == 502