updated authentication on protected pages
This commit is contained in:
@@ -162,11 +162,21 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
let thisSession = await getSession(ctx);
|
||||
|
||||
console.log(
|
||||
"auth sess for register :",
|
||||
thisSession,
|
||||
thisSession.user.email
|
||||
);
|
||||
// console.log(
|
||||
// "auth sess for register :",
|
||||
// thisSession,
|
||||
// thisSession.user.email
|
||||
// );
|
||||
|
||||
if (!thisSession) {
|
||||
console.log("not has sesssion.......");
|
||||
return {
|
||||
redirect: {
|
||||
destination: "/auth/signin",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user