From 7835167b8278c88dccbdfdf49ed987efe2811afd Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Sat, 12 Jul 2025 13:13:21 -0700 Subject: [PATCH] fix: add `image` option to `signUpEmail` types and schema (#3357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `signUpEmail` destructures the optional `image` field from the request body and uses it when creating the user, but the field isn’t in the `requestBody` schema or the `$Infer` `body` type --- packages/better-auth/src/api/routes/sign-up.test.ts | 1 + packages/better-auth/src/api/routes/sign-up.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/better-auth/src/api/routes/sign-up.test.ts b/packages/better-auth/src/api/routes/sign-up.test.ts index 1f91a13b22..a4efeb74dd 100644 --- a/packages/better-auth/src/api/routes/sign-up.test.ts +++ b/packages/better-auth/src/api/routes/sign-up.test.ts @@ -40,6 +40,7 @@ describe("sign-up with custom fields", async (it) => { email: "email@test.com", password: "password", name: "Test Name", + image: "https://picsum.photos/200", }, }); expect(res.token).toBeDefined(); diff --git a/packages/better-auth/src/api/routes/sign-up.ts b/packages/better-auth/src/api/routes/sign-up.ts index 9220e2665a..71461f0310 100644 --- a/packages/better-auth/src/api/routes/sign-up.ts +++ b/packages/better-auth/src/api/routes/sign-up.ts @@ -24,6 +24,7 @@ export const signUpEmail = () => name: string; email: string; password: string; + image?: string; callbackURL?: string; rememberMe?: boolean; } & AdditionalUserFieldsInput, @@ -48,6 +49,10 @@ export const signUpEmail = () => type: "string", description: "The password of the user", }, + image: { + type: "string", + description: "The profile image URL of the user", + }, callbackURL: { type: "string", description: