mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-23 07:18:56 -05:00
docs: Change role type from string to enum values
The example for the additional "role" field now uses an array instead of a raw string. This comes very handy when one is already using an enum-like DB schema (like `pgEnum`) and Drizzle for better type inference. By the way, I found out that this is allowed by accident from this test, so I am not even sure that this is the intended usage. https://github.com/better-auth/better-auth/pull/5287/files#diff-b98623fbecefef5313e8c1fe082f4895ee707cea0183c5cf4f860942cf3d0e3e
This commit is contained in:
@@ -406,7 +406,7 @@ export const auth = betterAuth({
|
||||
user: {
|
||||
additionalFields: {
|
||||
role: {
|
||||
type: "string",
|
||||
type: ["user", "admin"],
|
||||
required: false,
|
||||
defaultValue: "user",
|
||||
input: false, // don't allow user to set role
|
||||
|
||||
Reference in New Issue
Block a user