legal-consent plugin not extending authClient.signUp.email

Hi all! Just getting to know the plugin ecosystem of better-auth and I must say I am very happy with better-auth so far! When using the legal-consent plugin I have hit a snag, it doesn't seem like it's extending the auth client properly and thus won't pass the tosAccepted and privacyPolicyAccepted fields through to the database resulting in DB errors due to a missing field. I also get the following TS error on the client implementation in the frontend:
Object literal may only specify known properties, and 'tosAccepted' does not exist in type 'Prettify<{ email: string; name: string; password: string; image?: string | undefined; callbackURL?: string | undefined; fetchOptions?: { onRequest: () => void; onSuccess: () => void; onError: (ctx: ErrorContext) => void; } | undefined; }>'.
Object literal may only specify known properties, and 'tosAccepted' does not exist in type 'Prettify<{ email: string; name: string; password: string; image?: string | undefined; callbackURL?: string | undefined; fetchOptions?: { onRequest: () => void; onSuccess: () => void; onError: (ctx: ErrorContext) => void; } | undefined; }>'.
Does anyone have a reference implementation of this plugin or can anyone confirm that it works?
No description
10 Replies
Johan K
Johan KOP5mo ago
No description
Ping
Ping5mo ago
Hey @Johan K I'll look into this. By the way, this is part of Better-Auth-Kit, not part of Better-Auth directly. Just an FYI ^ But it's no worries, I'm the creator of BA kit, so I'll look into this 😁
Johan K
Johan KOP5mo ago
Sorry about that! I've now found the correct discord :) Thank you for looking into it! Would it be suitable to repost in the other community as well for tracking purposes or is it fine keeping it here?
Ping
Ping5mo ago
It's fine over here
Ping
Ping5mo ago
Hey so I've made some changes to the plugin, please install the latest version. All of your concerns should be address on the legal consent documentation which I've updated. https://www.better-auth-kit.com/docs/plugins/legal-consent
Better Auth Kit
Better Auth Kit
A handy collection of plugins, adapters, libraries and more.
Johan K
Johan KOP5mo ago
Thank you for this, I've just gotten the change to try it. Sadly I'm still facing an issue as it is not only the type being extended, but it's not passing the variable to the database at all
2025-05-07T18:36:43.598Z ERROR [Better Auth]: Failed to create user PrismaClientValidationError:
Invalid `prisma.user.create()` invocation:

{
data: {
name: "Johan K",
email: "REDACTED",
emailVerified: false,
createdAt: new Date("2025-05-07T18:36:43.595Z"),
updatedAt: new Date("2025-05-07T18:36:43.595Z"),
id: "REDACTED",
+ tosAccepted: Boolean
},
select: undefined
}

Argument `tosAccepted` is missing.
2025-05-07T18:36:43.598Z ERROR [Better Auth]: Failed to create user PrismaClientValidationError:
Invalid `prisma.user.create()` invocation:

{
data: {
name: "Johan K",
email: "REDACTED",
emailVerified: false,
createdAt: new Date("2025-05-07T18:36:43.595Z"),
updatedAt: new Date("2025-05-07T18:36:43.595Z"),
id: "REDACTED",
+ tosAccepted: Boolean
},
select: undefined
}

Argument `tosAccepted` is missing.
Ping
Ping5mo ago
You need to run the better-auth migration CLI if you haven't already
Johan K
Johan KOP5mo ago
The columns exist in the database, they're just not getting passed from better-auth to Prisma @Ping Have you had the time to replicate this?
Ping
Ping5mo ago
Hey sorry, been super busy, will look into this asap! By the way, this is definitely an issue on our end. Apologies for that. Hey I just added tests to the legal-consent plugin, and everything looks good on my end. It seems I was wrong about my assumption.
Johan K
Johan KOP5mo ago
Let me know of there's anything I can do

Did you find this page helpful?