updated authentication on protected pages
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user