Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

fix(auth): add fieldName for customPlan to resolve schema mismatch in Better Auth 1.7

Bill Yange9b940cface3
diff --git a/server/src/lib/auth.ts b/server/src/lib/auth.ts
index 4b743b7de..fe57c5083 100644
--- a/server/src/lib/auth.ts
+++ b/server/src/lib/auth.ts
@@ -209,6 +209,11 @@ const pluginList = [
customPlan: {
type: "string",
required: false,
+ // Column is snake_case (jsonb "custom_plan" in schema.ts). Without
+ // this, Better Auth 1.7's startup schema check looks for a
+ // "customPlan" column, reports SCHEMA_MISMATCH, and every
+ // /api/auth/* request 500s.
+ fieldName: "custom_plan",
},
},
},