duplicate contacts catch and handle and welsh

This commit is contained in:
2024-06-11 16:45:41 +01:00
parent e8c3d97f30
commit 2b9c160aee
13 changed files with 153 additions and 28 deletions
+19
View File
@@ -191,6 +191,25 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getPortalLogin(thisSession.user.email),
]);
//grabs first contact on this list
//jump out page for duplicates....
console.log(
"Number of contacts with this email:",
loggedInUser.value.length
);
if (loggedInUser.value.length > 1) {
return {
redirect: {
destination:
ctx.locale == "cy"
? "/cy/manylionpellach"
: "/furtherdetails",
permanent: false,
},
};
}
loggedInUser = loggedInUser.value[0].contactid;
//console.log("nextAuth Session:", thisSession);
}