reps trigger for logged out & upload storage acc

This commit is contained in:
2023-01-05 14:26:08 +00:00
parent 98aefdd867
commit ee4d00a500
16 changed files with 251 additions and 465 deletions
+12 -10
View File
@@ -162,23 +162,25 @@ export const getServerSideProps = wrapper.getServerSideProps(
let loggedInUserCookie = cookies.pinsUser;
let thisSession = await getSession(ctx);
let loggedInUser = {};
let [loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email),
]);
loggedInUser = loggedInUser.value[0].contactid;
console.log("nextAuth Session:", thisSession);
if (_.has(thisSession, "user") == false) {
if (!thisSession) {
console.log("not has sesssion.......");
return {
redirect: {
destination: "/error",
destination: "/auth/signin",
permanent: false,
},
};
}
} else {
console.log(" has sesssion.......");
[loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email),
]);
loggedInUser = loggedInUser.value[0].contactid;
console.log("nextAuth Session:", thisSession);
}
//Create Storage container for logged in user
await createContainer(thisSession.user.id);