Closed erikrj closed 5 months ago
Hi @erikrj , user attributes are not necessarily contained in session records, as there can be custom user attributes, e.g., roles, bios, addresses, ...
You may want to replicate all user data in sessions, but this is also problematic because
lucia.createSession(userId, sessionAttributes)
. The adapter should only be responsible for persisting the data as is that are passed to it in setSession(databaseSession)
, not creating or mutating them;Again, please run the tests to check whether the update works with docker compose run --rm app npm run test
.
Thanks. I didn't understand how lucia was handling users. I'll make an alternative modification.
The getSessionAndUser methods on DynamoDBAdapter1 and DynamoDBAdapter2 are making two calls to DynamoDB and only need to make one. I think it's reasonable to require ProjectionType set to all for the Gsi and you already have this in your README example. Removing this call cuts the potential costs associated with DynamoDB when using this adapter and it will improve performance.