Bug with admin plugin and renamed fields
I'm using the admin plugin, which adds a "role" field, I wanted to rename it "better_auth_role", so in the BetterAuth conf I did eg
but when trying to create a user with auth.api.createUser it complains
The field "role" does not exist in the "usersTable" schema. Please update your drizzle schema or re-generate using "npx @better-auth/cli generate
so it correctly saw that I renamed my table to usersTable (also it works for the other fields like emailVerified, etc) but it seems the admin plugin fields are not translated?
3 Replies
change the fields within the admin plugin instead
there is indeed a
fields
in the admin plugin config that can be overriden