Closed Blankeos closed 2 weeks ago
Oh well. spoke too soon. Can change this to a docs enhancement maybe?
const session = await lucia.createSession(userId, {}, {
sessionId: new ObjectId().toString()
});
Actually idk if it even fits the docs at the moment. Might just make it more cluttered. I guess an issue is enough. Someone'll probably search for this anyway.
I would not use Object IDs for session IDs as they, at best, only provide 96 bits of entropy (in reality it only provides 24 bits of true randomness).
Looks like the sessionId
option is undocumented, even in the API reference - sorry about that! Can you create a new issue for that?
Package
lucia
Describe the bug
Idk how else to describe the error. Seems to me that Lucia doesn't have a way to change the createID function for sessions? Correct me if I'm wrong though. Preferably, I could use MongoDB's
ObjectId
which is a 24 character hexstringModel: