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,
},
});
7 Replies
neetras
neetrasOP2d ago
GET /ok returns
{
"ok": true
}
{
"ok": true
}
neetras
neetrasOP2d ago
Sign up gets hanged as well
No description
Ping
Ping2d ago
Why not try the authClient itself?
neetras
neetrasOP2d ago
I need to test other endpoints in Postman which requires me to login first. Also, what if I want to integrate the API in other platforms which doesn't have better auth client? @Ping
Ping
Ping2d ago
I need to test other endpoints in Postman which requires me to login first.
Okay.
what if I want to integrate the API in other platforms which doesn't have better auth client?
That's fine, I just mean for testing purposes.
neetras
neetrasOP2d ago
Yeah the auth client works, it's just not working through the rest endpoints
Ping
Ping2d ago
The authClient uses those same endpoints. Are you sure you're passing all the necessary data to make the request?

Did you find this page helpful?