kleydon / prisma-session-store

Express session store for Prisma
MIT License
116 stars 18 forks source link

Add option for sessionModelName #52

Closed jeremygottfried closed 2 years ago

jeremygottfried commented 2 years ago

eg usage:

session({
  secret: process.env.COOKIE_SECRET || 'secret',
  store: new PrismaSessionStore(
     prisma,
     {
       sessionModelName: 'oAuthSession'
     }
   ),
  cookie: { maxAge: 7 * 24 * 60 * 60 * 1000 } // 1 week
})
jeremygottfried commented 2 years ago

Hi @jeremygottfried, appreciate your PR.

I just tried to run the test suite using yarn test (can also use npm run test), and its not yet working for me... Would you consider updating this, so that the tests pass? Guessing the issue is on line 29 of src/lib/prisma-session-store.spec.ts.

Best,

-K

Yeah I'll try to get to it this weekend.

wSedlacek commented 2 years ago

@jeremygottfried Would you mind if I updated the types for you? The getting the generic to infer correctly can be a bit tricky and I got a few hours to spare this week.

jeremygottfried commented 2 years ago

@wSedlacek yeah that would be great thanks!

wSedlacek commented 2 years ago

Here is a PR into your PR - https://github.com/jeremygottfried/prisma-session-store/pull/1

kleydon commented 2 years ago

:tada: This PR is included in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: