updated storage account stuff to take auth id

This commit is contained in:
2022-08-26 15:19:34 +01:00
parent 671d49c394
commit 862a953aae
18 changed files with 346 additions and 133 deletions
+9 -6
View File
@@ -16,7 +16,10 @@ import Footer from "../components/footer";
import Header from "../components/header";
import Main from "../components/main";
import ServiceBanner from "../components/servicebanner";
import { setAccountDetails } from "../store/accountDetails/action";
import {
setAccountDetails,
setContainerID,
} from "../store/accountDetails/action";
import { getGovGatewayConfig } from "../store/govgateway/action";
import { wrapper } from "../store/store";
import { getSession, useSession, signIn, signOut } from "next-auth/react";
@@ -169,12 +172,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
let thisSession = await getSession(ctx);
console.log(ctx);
var relayToken = await getToken();
relayToken = relayToken.access_token;
console.log("auth sess:", thisSession);
console.log("\n///////////////\nauth sess:", thisSession);
const showLoginCheck = process.env.SHOWLOGIN || false;
const showMapCheck = process.env.SHOWMAPS || false;
@@ -187,7 +188,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
let ggLocale =
typeof query.ui_locales != "undefined" && query.ui_locales;
console.log("\n", "hasloginCode:", hasLoginCode);
console.log("hasloginCode:", hasLoginCode);
// store.dispatch(getGovGatewayConfig(providerConfig));
@@ -198,6 +199,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
if (hasLoginCode == true) {
loginEmailStr = hashString(thisSession.user.email);
store.dispatch(setContainerID(thisSession.user.id));
portalUserObj = await getPortalLogin(
thisSession.user.email,
relayToken
@@ -220,7 +223,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
} else {
console.log("empty session");
}
console.log("///////////////\n");
if (ggToken.status == 400) {
return {
redirect: {