BA
Better Auth•3w ago
Hatila

Type error in "signUp" after renaming "name" in "user" table

Hello, I'm trying to rename a column in the user table. Here is my auth config: user: { fields: { name: "firstName", }, The client code: I'm using in the auth-client: inferAdditionalFields<Auth>(), const { error } = await authClient.signUp.email({ firstName, -> TS Error lastName, email, password, language: language || "en", }); Here is the error:
Object literal may only specify known properties, and 'firstName' does not exist in type 'Prettify<InferSignUpEmailCtx<{ baseURL: string; plugins: ({ id: "two-factor"; $InferServerPlugin: { id: "two-factor"; endpoints: { enableTwoFactor: { <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: { body: { password: string; issuer?: string | undefined; }; } & ... 6 more ... ...'.
Any help is welcomed
Solution:
You still need to use name in the signUp
Jump to solution
3 Replies
Solution
Soheel
Soheel•3w ago
You still need to use name in the signUp
Soheel
Soheel•3w ago
The mapping only maps their parameter names to your internal db schema As far as I am concerned so e.g.
const { error } = await authClient.signUp.email({
name: firstName,
lastName,
email,
password,
language: language || "en",
});
const { error } = await authClient.signUp.email({
name: firstName,
lastName,
email,
password,
language: language || "en",
});
Hatila
HatilaOP•3w ago
Thanks! It works but not very straightforward imo 🤔

Did you find this page helpful?