vvo/iron-session

Get slug from withIronSessionSsr

dandelion-lowcode opened this issue · 1 comments

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.

It just sufficed to add params in the function, together with req and res.