etherCorps / SK-Redis-SessionManager

Redis integration in SvelteKit for Session Management
https://sk-vercel-ioredis.vercel.app/
MIT License
25 stars 3 forks source link

`getSession` is currently broken #3

Closed hallowatcher closed 1 year ago

hallowatcher commented 1 year ago

https://github.com/etherCorps/SK-Redis-SessionManager/blob/e28b5ca531c403b58d4ecd5a0cb535917065563c/src/lib/providers/ioredis.ts#L113

I believe this line of code need to be:

const sessionData = await this.redisClient.get(sessionId);

since the sessionId is already stored with the colon in redis:

image

Another option is to store the key without the left part of the colon: ghrVLf9Ge1ZSjo4ZtiVO4plA0Q47U5N7CFXF in that example.

Otherwise it will try to find sk_ioredis_session:sk_ioredis_session:ghrVLf9Ge1ZSjo4ZtiVO4plA0Q47U5N7CFXF, which it can't:

image

I'm currently on version 1.0.3.

PS also check the other providers and functions

theetherGit commented 1 year ago

Sure, i'll look into it.

theetherGit commented 1 year ago

@hallowatcher can you please tell me with manager you are using?

hallowatcher commented 1 year ago

@theetherGit im using Another Redis Desktop Manager (https://github.com/qishibo/AnotherRedisDesktopManager) and as Provider im using ioredis, but I would assume the same happens with the regular redis provider as the lines of code are the same.

theetherGit commented 1 year ago

ok ioredis.

theetherGit commented 1 year ago

Sorry, I literally made a big mistake. New version will be released with examples by midnight.