Closed nirtamir2 closed 1 week ago
Thanks for the PR! We're going to discuss a bit internally on what the best course of action here is. We're thinking in particular on how we can make some high-level abstractions to make this easier on you.
High-level abstractions would be great but just exporting those would make the library useful to anyone migrating from other session management implementations, right now it assumes you don't have a previous one in place.
We are doing the same copy/paste + iron-session dependency to properly migrate our users from their previous sessions.
Higher level abstractions now exist in the Node SDK: https://workos.com/docs/reference/user-management/session-helpers
This PR export
cookieOptions
,cookieName
andencryptSession
from WorkOS. The motivation to do it is for people who try to implement the authentication themself and need to copy the code from this repository (that may change in the future). Also, I need to installiron-session
as a dependency in my project if I implement it myself.Alternatively, I could create a function that sets the cookie like the SDK instead of writing this code the codebase:
Notes:
I still haven't organized everything properly with my implementation, but it seems like I need to export those parts from the SDK to implement it. Feel free to change or block this PR if you feel it's wrong :)