updated authentication on protected pages
This commit is contained in:
@@ -207,6 +207,31 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
// awaitingSubmissionFromBlob.case
|
||||
// );
|
||||
|
||||
console.log(
|
||||
"preferred language:",
|
||||
accountDetails.pinswg_preferredlanguage
|
||||
);
|
||||
|
||||
console.log(
|
||||
"locale :",
|
||||
accountDetails.pinswg_preferredlanguage == "846040000" ? "cy" : "en"
|
||||
);
|
||||
|
||||
console.log("req locale :", ctx.locale);
|
||||
|
||||
const preferredLocale =
|
||||
accountDetails.pinswg_preferredlanguage == "846040000"
|
||||
? "cy"
|
||||
: "en";
|
||||
|
||||
// if (preferredLocale != ctx.locale) {
|
||||
// return {
|
||||
// redirect: {
|
||||
// destination: "/cy/myportal",
|
||||
// permanent: false,
|
||||
// },
|
||||
// };
|
||||
// } else {
|
||||
if (_.has(accountDetails, "errorCode") != false) {
|
||||
return {
|
||||
redirect: {
|
||||
@@ -255,6 +280,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
},
|
||||
};
|
||||
}
|
||||
// }
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user