Invalid Email - Bad Request

I'm getting this error when doing a basic signup. Using SvelteKit. Auth Client:
import { createAuthClient } from "better-auth/svelte"
export const authClient = createAuthClient({})
import { createAuthClient } from "better-auth/svelte"
export const authClient = createAuthClient({})
Auth:
import { betterAuth } from "better-auth";
import { MongoClient } from "mongodb";
import { mongodbAdapter } from "better-auth/adapters/mongodb";

import { MONGODB_URI } from "$env/static/private";

const client = new MongoClient(MONGODB_URI);
const db = client.db();

export const auth = betterAuth({
database: mongodbAdapter(db),
emailAndPassword: {
enabled: true
}
})
import { betterAuth } from "better-auth";
import { MongoClient } from "mongodb";
import { mongodbAdapter } from "better-auth/adapters/mongodb";

import { MONGODB_URI } from "$env/static/private";

const client = new MongoClient(MONGODB_URI);
const db = client.db();

export const auth = betterAuth({
database: mongodbAdapter(db),
emailAndPassword: {
enabled: true
}
})
Signup:
const { data, error } = await authClient.signUp.email({
emailValue,
passwordValue,
nameValue,
// callbackURL: "/"
}, {
onRequest: (ctx) => {
},
onSuccess: (ctx) => {
},
onError: (ctx) => {
alert(JSON.stringify(ctx.error));
},
});
const { data, error } = await authClient.signUp.email({
emailValue,
passwordValue,
nameValue,
// callbackURL: "/"
}, {
onRequest: (ctx) => {
},
onSuccess: (ctx) => {
},
onError: (ctx) => {
alert(JSON.stringify(ctx.error));
},
});
I have confirmed that emailValue and passwordValue are accurate.
No description
Solution:
Oh. I fixed it. My variables weren't labeled.
Jump to solution
2 Replies
Solution
Loudbook
Loudbook6d ago
Oh. I fixed it. My variables weren't labeled.
Loudbook
LoudbookOP6d ago
Embarrassing

Did you find this page helpful?