Zetax
Zetax3w ago

Random 400 errors errors with convex better auth

Hey, I am using convex with better-auth but I am always randomly getting a 400 error on the /api/auth/sign-in/social route with the error:
{"code":"VALIDATION_ERROR","message":"Invalid body parameters"}
{"code":"VALIDATION_ERROR","message":"Invalid body parameters"}
Has anyone experienced this before? I am just using this code for signing in: await authClient.signIn.social({ provider: "discord" });
6 Replies
Convex Bot
Convex Bot3w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart3w ago
What version of better-auth are you on
Zetax
ZetaxOP3w ago
1.3.4 The one it showed in the convex-better-auth docs
erquhart
erquhart3w ago
Are you using additionalFields by chance? can you share your better auth config
Zetax
ZetaxOP3w ago
Nope. I am just using the default better auth convex config afaik
export const createAuth = (ctx: GenericCtx) =>
betterAuth({
baseURL: siteUrl,
database: convexAdapter(ctx, betterAuthComponent),
socialProviders: {
discord: {
clientId: discordClientId,
clientSecret: discordClientSecret,
},
},
plugins: [
convex(),
],
});
export const createAuth = (ctx: GenericCtx) =>
betterAuth({
baseURL: siteUrl,
database: convexAdapter(ctx, betterAuthComponent),
socialProviders: {
discord: {
clientId: discordClientId,
clientSecret: discordClientSecret,
},
},
plugins: [
convex(),
],
});
Happy to provide other code / logs as well Fixed it! Followed an old thread that had the exact same problem on here. It was a node 20.09 issue. https://discord.com/channels/1019350475847499849/1396520106477228143
erquhart
erquhart3w ago
Ah! I completely forgot to search our own discord, good find

Did you find this page helpful?