Asynchronous dbRecordIdFunction support
#136
Replies: 2 comments 1 reply
-
|
@TokugawaTakeshi thanks for this.
In the prisma schema, Does that sound right? |
Beta Was this translation helpful? Give feedback.
-
Interesting; I haven't thought extensively about this... (And I don't know very much about database-related workflows, so it is very likely that there are opportunities for improvements, here.) Note: If you have access to the database, it is possible that you can create/edit ids in ways that are not controlled by this session store... For instance, in Prisma's "Studio" interface, you can edit session ids as free text (even enter a null string value!) So, even if efforts are made to tighten/restrict ID generation within prisma-session-store, we can't protect against scenarios that create/edit ids from outside the session store.
Trying to remember... I believe the idea was that we don't want to force a user to use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Even CUID does not guarantee the full prevention of collisions, same about NanoID and UUID.
For the session ID, the collision is critical because if it will occur it will entail the leaking of personal and confidential data.
Thus after generating of ID, it is required to check the database table for duplication what is the asynchronous operation while
dbRecordIdFunctiondoes not support asynchronous generating.Why not to leave to prisma-session-store the generating of ID?
Because it does not fit to the following approach.
Beta Was this translation helpful? Give feedback.
All reactions