deltasoneca
03/19/2021, 12:37 PMgetServerSideProps()
. It is not advised to use fetch()
there as the template does in the client side. So what should I do?
I was able to make it work using the code below, but I am not sure it's the best way to do it -- I just adapted the code present in the template.
Also this does not return the email used for login (I am not using social login). I need the email.
await superTokensNextWrapper(
async next => {
return await verifySession()(context.req, context.res, next);
},
context.req,
context.res
);
const { userId } = await context.req.session;
Any help is appreciated! Thanks!