neetras
neetras
BABetter Auth
Created by neetras on 4/28/2025 in #help
Sign in request gets hanged
I tried from the /api/auth/reference scaler page, curl and also postman, but the server doesn't return anything and the request gets hanged.
curl http://localhost:3000/api/auth/sign-in/email \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"password": "1234567890"
}'
curl http://localhost:3000/api/auth/sign-in/email \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"password": "1234567890"
}'
Here is my auth setup,
export const auth = betterAuth({
appName: "myapp",
database: drizzleAdapter(db, {
provider: "pg",
usePlural: true,
schema: {
users: UserTable,
sessions: SessionTable,
accounts: AccountTable,
verifications: VerificationTable,
},
}),
plugins: [
expo(),
emailOTP({
async sendVerificationOTP({ email, otp, type }) {
console.log(`${email}, ${otp}, ${type}`);
},
}),
admin({
ac: permissions.ac,
defaultRole: "user",
roles: {
admin: permissions.admin,
user: permissions.user,
},
}),
openAPI(),
],
user: {
modelName: "users",
fields: {
name: "firstName",
},
additionalFields: {
lastName: {
type: "string",
required: true,
},
},
},
emailAndPassword: {
enabled: true,
},
});
export const auth = betterAuth({
appName: "myapp",
database: drizzleAdapter(db, {
provider: "pg",
usePlural: true,
schema: {
users: UserTable,
sessions: SessionTable,
accounts: AccountTable,
verifications: VerificationTable,
},
}),
plugins: [
expo(),
emailOTP({
async sendVerificationOTP({ email, otp, type }) {
console.log(`${email}, ${otp}, ${type}`);
},
}),
admin({
ac: permissions.ac,
defaultRole: "user",
roles: {
admin: permissions.admin,
user: permissions.user,
},
}),
openAPI(),
],
user: {
modelName: "users",
fields: {
name: "firstName",
},
additionalFields: {
lastName: {
type: "string",
required: true,
},
},
},
emailAndPassword: {
enabled: true,
},
});
9 replies