migrate auth db to sql server

This commit is contained in:
2022-08-23 15:06:55 +01:00
parent 4b38849f1d
commit 69a81e482f
13 changed files with 194 additions and 91 deletions
+11 -1
View File
@@ -1,5 +1,7 @@
import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { getSession, useSession } from "next-auth/react";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import {
@@ -24,7 +26,7 @@ import { getGovGatewayConfig } from "../../store/govgateway/action";
import { getProviderConfig } from "../../actions/govgateway";
const Home = (props) => {
const { footerLinks, pages, formData } = props;
const { footerLinks, pages, formData, loggedInUserIdent } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -118,6 +120,7 @@ const Home = (props) => {
appealType={props.setAppealType}
loggedInUser={props.accountDetails.loggedinUserId}
whichForm={props.form}
loggedInUserIdent={loggedInUserIdent}
/>
</main>
</div>
@@ -135,7 +138,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
const { cookies } = req;
console.log("/newappeal - cookies ", cookies);
let thisSession = await getSession(ctx);
console.log("nextAuth Session:", thisSession);
let loggedInUserIdent = thisSession.user.id;
let loggedInUser = cookies.pinsUser;
console.log("has loggedInUser", loggedInUser);
@@ -157,6 +163,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setLPA(lpaData));
store.dispatch(setLoggedInUserId(loggedInUser));
store.dispatch(setAccountDetails(accountDetails));
return {
props: { loggedInUserIdent: loggedInUserIdent },
};
}
);