updated authentication on protected pages

This commit is contained in:
2023-06-05 12:00:28 +01:00
parent 3dd4525770
commit 31375a5999
20 changed files with 408 additions and 119 deletions
+10
View File
@@ -225,6 +225,16 @@ export const getServerSideProps = wrapper.getServerSideProps(
let thisSession = await getSession(ctx);
//console.log("nextAuth Session:", thisSession);
if (!thisSession) {
console.log("not has sesssion.......");
return {
redirect: {
destination: "/auth/signin",
permanent: false,
},
};
}
let loggedInUserIdent = thisSession.user.id;
let loggedInUserEmail = thisSession.user.email;