deltasoneca7034
03/19/2021, 8:57 PMimport { superTokensNextWrapper } from "supertokens-node/nextjs";
import { verifySession } from "supertokens-node/recipe/session";
import { getUserById } from "supertokens-node/recipe/thirdpartyemailpassword";
export async function getServerSideProps(context) {
await superTokensNextWrapper(
async next => {
return await verifySession()(context.req, context.res, next);
},
context.req,
context.res
);
const { userId } = context.req.session;
const userData = await getUserById(userId);
return { props: { userData } };
}
(I'll do more things with the user email there, I am just copying the relevant code here)