Get slug from withIronSessionSsr
dandelion-lowcode opened this issue · 1 comments
dandelion-lowcode commented
Hi,
I need to access a slug in getServerSideProps
, but also the current session.
export const getServerSideProps = withIronSessionSsr(async function ({
req,
res,
}) {
req.session.user // ✔️ I can access this information
context.params?.slug // ❌ I cannot access this
}
This would be trivial without withIronSessionSsr
, but I need both pieces of information. Is the slug hidden somewhere in req
?
Thank you.
dandelion-lowcode commented
It just sufficed to add params
in the function, together with req
and res
.