2ram
2ram
BABetter Auth
Created by 2ram on 4/15/2025 in #help
Issue with sign up using express
link to the docs where this is said: https://www.better-auth.com/docs/integrations/express
9 replies
BABetter Auth
Created by 2ram on 4/15/2025 in #help
Issue with sign up using express
@KiNFiSH I tried this, it allows for the request to finally go through but then the client side gets stuck on pending. Looking at the docs it says
Don’t use express.json() before the Better Auth handler. Use it only for other routes, or the client API will get stuck on "pending".
Don’t use express.json() before the Better Auth handler. Use it only for other routes, or the client API will get stuck on "pending".
Because of this I don't think this is the correct solution
9 replies
BABetter Auth
Created by 2ram on 4/15/2025 in #help
Issue with sign up using express
prima.schema
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
email String @unique
name String
emailVerified Boolean @default(false)
image String?
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
sessions Session[]
accounts Account[]

@@map("user")
}

model Session {
id String @id
expiresAt DateTime
token String
createdAt DateTime
updatedAt DateTime
ipAddress String?
userAgent String?
userId String @db.Uuid
user User @relation(fields: [userId], references: [id], onDelete: Cascade)

@@unique([token])
@@map("session")
}

model Account {
id String @id
accountId String
providerId String
userId String @db.Uuid
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
accessToken String?
refreshToken String?
idToken String?
accessTokenExpiresAt DateTime?
refreshTokenExpiresAt DateTime?
scope String?
password String?
createdAt DateTime
updatedAt DateTime

@@map("account")
}

model Verification {
id String @id
identifier String
value String
expiresAt DateTime
createdAt DateTime?
updatedAt DateTime?

@@map("verification")
}
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
email String @unique
name String
emailVerified Boolean @default(false)
image String?
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
sessions Session[]
accounts Account[]

@@map("user")
}

model Session {
id String @id
expiresAt DateTime
token String
createdAt DateTime
updatedAt DateTime
ipAddress String?
userAgent String?
userId String @db.Uuid
user User @relation(fields: [userId], references: [id], onDelete: Cascade)

@@unique([token])
@@map("session")
}

model Account {
id String @id
accountId String
providerId String
userId String @db.Uuid
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
accessToken String?
refreshToken String?
idToken String?
accessTokenExpiresAt DateTime?
refreshTokenExpiresAt DateTime?
scope String?
password String?
createdAt DateTime
updatedAt DateTime

@@map("account")
}

model Verification {
id String @id
identifier String
value String
expiresAt DateTime
createdAt DateTime?
updatedAt DateTime?

@@map("verification")
}
I followed the core schema provided here: https://www.better-auth.com/docs/concepts/database#account
9 replies