added hashing on api calls

This commit is contained in:
2022-07-12 12:49:26 +01:00
parent f23ad2a300
commit be9f86b6b2
13 changed files with 234 additions and 158 deletions
+8 -18
View File
@@ -32,6 +32,7 @@ const Home = (props) => {
loginEmailStr,
loggedInUserEmail,
ggLocale,
hasLoginCode,
} = props;
let { t, lang } = useTranslation();
@@ -43,7 +44,7 @@ const Home = (props) => {
expDate.setDate(now.getDate() + 1);
//console.log("hashed email str", loginEmailStr);
_.isEmpty(loggedInUserId) != false && !hasGGCode
hasLoginCode != false
? console.log("no session")
: _.has(loggedInUserId, "value")
? _.isEmpty(loggedInUserId.value)
@@ -144,8 +145,8 @@ const Home = (props) => {
showLogin={showLogin}
showMap={showMap}
loggedInUserId={loggedInUserId}
GG_REDIRECT_URI={props.GG_REDIRECT_URI}
GG_CLIENT_ID={props.GG_CLIENT_ID}
// GG_REDIRECT_URI={props.GG_REDIRECT_URI}
// GG_CLIENT_ID={props.GG_CLIENT_ID}
/>
</>
)}
@@ -172,22 +173,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
const hasLoginCode = thisSession != null;
let providerConfig = await getProviderConfig();
// let providerConfig = await getProviderConfig();
let ggLocale =
typeof query.ui_locales != "undefined" && query.ui_locales;
console.log(
"endpoint: ",
providerConfig.token_endpoint,
"\n",
"hasloginCode:",
hasLoginCode,
"\n",
"redirect:",
process.env.GG_REDIRECT_URI
);
console.log("\n", "hasloginCode:", hasLoginCode);
store.dispatch(getGovGatewayConfig(providerConfig));
// store.dispatch(getGovGatewayConfig(providerConfig));
let ggToken = {};
let ggUserInfo = {};
@@ -219,11 +211,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
ggLocale: ggLocale,
showLogin: showLoginCheck,
showMap: showMapCheck,
hasGGCode: hasLoginCode,
hasSession: hasLoginCode,
loggedInUserId: portalUserObj,
loggedInUserEmail: loginEmailStr,
GG_REDIRECT_URI: process.env.GG_REDIRECT_URI,
GG_CLIENT_ID: process.env.GG_CLIENT_ID,
},
};
}