Unprocessable Entity on Signup

Hey, just ecountered an Error I haven't seen. This happens when trying to signup via the authClient. This is my code:
const { data, error } = await auth.signUp.email({
email: formData.email,
password: formData.password,
name: formData.name,
callbackURL: "/dashboard"
}, {
onRequest: () => {
setIsLoading(true)
},
onSuccess: () => {
toast.success("Account created successfully! Please check your email to verify your account.")
router.push("/login")
},
onError: (ctx: SignUpContext) => {
toast.error(ctx.error?.message || "Failed to create account")
},
})
const { data, error } = await auth.signUp.email({
email: formData.email,
password: formData.password,
name: formData.name,
callbackURL: "/dashboard"
}, {
onRequest: () => {
setIsLoading(true)
},
onSuccess: () => {
toast.success("Account created successfully! Please check your email to verify your account.")
router.push("/login")
},
onError: (ctx: SignUpContext) => {
toast.error(ctx.error?.message || "Failed to create account")
},
})
No description
11 Replies
Ping
Ping5d ago
What does your server logs say? @Zetax
Zetax
ZetaxOP5d ago
No errors or anything, just the logging indicating that it returned that response
No description
Ping
Ping5d ago
can I see your auth config + any potential schema files you may have
Ping
Ping5d ago
If you want to use uuid, you must disable ID generation from Better Auth, and allow your DB to generate the IDs. In BA, in your auth config, set advanced.database.generateId to false. Then in your drizzle schema, set your id to this: uuid('id').defaultRandom().primaryKey(), @Zetax
Zetax
ZetaxOP5d ago
This key does not exist for me apparently. I'll try updating
No description
Zetax
ZetaxOP5d ago
Still does not exist
Ping
Ping5d ago
Update Better-Auth to latest.
Zetax
ZetaxOP5d ago
Worked after restarting TS server
Ping
Ping5d ago
What version? Oh, good.
Zetax
ZetaxOP4d ago
That fixed it, I'll mark this as resolved Thank you

Did you find this page helpful?