squiggle
squiggle copied to clipboard
Patch PrismaAdapter to select username immediately
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
Still possible and could be a nice optimization.