reps trigger for logged out & upload storage acc
This commit is contained in:
+12
-10
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user