Description and expected behavior
When findOne or findMany are called without a select parameter, the adapter passes select: undefined to Zenstack's query methods. In Zenstack/Prisma, this is treated as an explicit instruction to select zero fields, rather than selecting all fields.
When no select is specified, all fields should be returned (default Prisma behavior)
Steps to reproduce
- Call
adapter.findOne({ model: 'twoFactor', where: [...] }) without a select parameter
- Observe that the returned object has no fields (or only some fields)
Environment (please complete the following information):
- ZenStack version: 3.5.3
- better-auth 1.5.6
- Database type: Postgresql
- Node.js/Bun version: 20.19.2
- Package manager: npm
Additional context
When verifying a 2FA backup/recovery code, a downstream query fails
Description and expected behavior
When
findOneorfindManyare called without aselectparameter, the adapter passesselect: undefinedto Zenstack's query methods. In Zenstack/Prisma, this is treated as an explicit instruction to select zero fields, rather than selecting all fields.When no select is specified, all fields should be returned (default Prisma behavior)
Steps to reproduce
adapter.findOne({ model: 'twoFactor', where: [...] })without aselectparameterEnvironment (please complete the following information):
Additional context
When verifying a 2FA backup/recovery code, a downstream query fails