From 37ae4ea6596b003a577bbbc0c8ae3bfce2c2457c Mon Sep 17 00:00:00 2001 From: Bennett Dams Date: Thu, 18 Dec 2025 04:37:11 +0100 Subject: [PATCH] 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 --- docs/content/docs/concepts/database.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/docs/concepts/database.mdx b/docs/content/docs/concepts/database.mdx index c07e7fe79e..0039c02c9a 100644 --- a/docs/content/docs/concepts/database.mdx +++ b/docs/content/docs/concepts/database.mdx @@ -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