updated authentication on protected pages

This commit is contained in:
2023-06-05 12:00:28 +01:00
parent 3dd4525770
commit 31375a5999
20 changed files with 408 additions and 119 deletions
+25 -13
View File
@@ -75,22 +75,34 @@ export const getServerSideProps = wrapper.getServerSideProps(
let thisSession = await getSession(ctx);
const [accountDetails, appealTypeData, lpaData] = await Promise.all([
await getPersonalAccount(loggedInUser),
await getAppealsTypes(),
await getLPA(),
]);
if (!thisSession) {
console.log("not has sesssion.......");
return {
redirect: {
destination: "/auth/signin",
permanent: false,
},
};
} else {
const [accountDetails, appealTypeData, lpaData] = await Promise.all(
[
await getPersonalAccount(loggedInUser),
await getAppealsTypes(),
await getLPA(),
]
);
// const lpaData = require("../../data/lpa.json");
// const appealTypeData = require("../../data/appealtypes.json");
// const lpaData = require("../../data/lpa.json");
// const appealTypeData = require("../../data/appealtypes.json");
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setLPA(lpaData));
store.dispatch(setLoggedInUserId(loggedInUser));
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setLPA(lpaData));
store.dispatch(setLoggedInUserId(loggedInUser));
thisSession != false &&
store.dispatch(setContainerID(thisSession.user.id));
thisSession != false &&
store.dispatch(setContainerID(thisSession.user.id));
}
}
);