squiggle icon indicating copy to clipboard operation
squiggle copied to clipboard

Patch PrismaAdapter to select username immediately

Open berekuk opened this issue 2 years ago • 1 comments

This is low priority and just a performance optimization, but would be nice to have.

We now have to do an extra SQL query when session is loaded: https://github.com/quantified-uncertainty/squiggle/blob/334aa2f37def71b84843b5fc4f64c344c3f38997/packages/hub/src/app/api/auth/%5B...nextauth%5D/authOptions.ts#L33

It shouldn't be too hard to patch PrismaAdapter (https://github.com/nextauthjs/next-auth/blob/b1c46809f5f623f4f7bb9f42fbab8d7866825997/packages/adapter-prisma/src/index.ts#L224) to select it immediately.

Related: https://github.com/nextauthjs/next-auth/issues/7003

berekuk avatar Sep 14 '23 18:09 berekuk

Still possible and could be a nice optimization.

berekuk avatar Jan 07 '25 18:01 berekuk