Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration away from withIronSessionApiRoute #679

Open
elie222 opened this issue Dec 31, 2023 · 3 comments
Open

Migration away from withIronSessionApiRoute #679

elie222 opened this issue Dec 31, 2023 · 3 comments

Comments

@elie222
Copy link

elie222 commented Dec 31, 2023

Upgrading from v6 to v8 of this package. What's the easiest way to migrate withIronSessionApiRoute?

@mschilde
Copy link

+1 on this. Is there an upgrade guide?

@sacru2red
Copy link

in my cases,

export default withIronSessionApiRoute(
  async function handler (
    req: NextApiRequest,
    res: NextApiResponse,
  ) {

 ...
}, IronSessionOptions)
export default async function handler (
    req: NextApiRequest,
    res: NextApiResponse,
) {
    const session = await getIronSession<ApiResonseData>(req, res, IronSessionOptions)
   ...
}

@mattcasey
Copy link

Here's the OG source code: https://github.com/vvo/iron-session/blob/v6/next/index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants