Closed master117 closed 3 years ago
I tried adjusting tests, but I'm not sure what is the best way to test this, since sids are randomized.
I'll give this a review tomorrow. Thank you!
Can you parse the results into your return object
Of course, my bad.
Tests adjusted as well.
Merged! I'll get it onto NPM shortly
What: Switched "all" methods return from
sessionData[]
to{ [sid: string]: sessionData }
, so it is possible to retrieve the sid of all sessions. Adjusted documentation.Why: I wanted to use the all method to find all sessions and then destroy all sessions for certain users / tokens. Without the sid it's not possible to destroy certain sessions. And my first implementation for the all method would not include sids.
Why not: { sid: string, data: sessionData }[] I actually would have prefered to return
{ sid: string, data: sessionData }[]
to easily link sid and session data but when looking at express-session index.d.ts I only found:all: (callback: (err: any, obj?: { [sid: string]: Express.SessionData; } | null) => void) => void;