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

Add applySession(req, res, options) method #41

Closed
vincentducorps opened this issue Apr 1, 2020 · 4 comments
Closed

Add applySession(req, res, options) method #41

vincentducorps opened this issue Apr 1, 2020 · 4 comments

Comments

@vincentducorps
Copy link

vincentducorps commented Apr 1, 2020

Hello,

Can you add applySession method just like https://github.com/hoangvvo/next-session#-applysession-

I prefer this approach (like in NextJS docs https://nextjs.org/docs/api-routes/api-middlewares) instead of withSession.

Thanks

@vvo
Copy link
Owner

vvo commented Apr 1, 2020

@vincentducorps Aside from syntax difference, does using withSession works for you? If so could you explain a bit more why applySession is better for your usecase? Happy to learn more here, thanks!

@vvo
Copy link
Owner

vvo commented Apr 27, 2020

Needs a clearer example/more explanation

@vvo vvo closed this as completed Apr 27, 2020
vvo added a commit that referenced this issue May 1, 2020
…uired

New features:
- an Express/Connect middleware: import { ironSession } from "next-iron-session"
  app.use(ironSession(options))
  or router.get("/", ironSession(options), (req, res, next) => {});
- import { applySession } from "next-iron-session":
  await applySession(req, res, options);

Examples:
- moved to examples/ folder
- added an Express example

BREAKING CHANGE:
- you need to import withIronSession as a named export:
before: import withIronSession from "next-iron-session"
after: import { withIronSession } from "next-iron-session"
- cookieName option is now mandatory (#54)

fixes #54
fixes #9
fixes #41
This was referenced May 1, 2020
vvo added a commit that referenced this issue May 1, 2020
…uired

New features:
- an Express/Connect middleware: import { ironSession } from "next-iron-session"
  app.use(ironSession(options))
  or router.get("/", ironSession(options), (req, res, next) => {});
- import { applySession } from "next-iron-session":
  await applySession(req, res, options);

Examples:
- moved to examples/ folder
- added an Express example

BREAKING CHANGE:
- you need to import withIronSession as a named export:
before: import withIronSession from "next-iron-session"
after: import { withIronSession } from "next-iron-session"
- cookieName option is now mandatory (#54)

fixes #54
fixes #9
fixes #41
@vvo
Copy link
Owner

vvo commented May 1, 2020

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@vvo
Copy link
Owner

vvo commented May 1, 2020

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@vvo vvo added the released label May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants