King Alastor
Explore posts from serversBABetter Auth
•Created by King Alastor on 2/27/2025 in #bug-reports
Better-auth cannot be set up using pg Pool and postgres
It seems somewhere in the code there's hardcoded user relation when trying to set up:
database: new Pool({
connectionString: process.env.DATABASE_URL,
}),
tables: {
user: "users",
account: "account",
session: "session",
verification: "verification"
},
re-mapping has no effect, you still get an error:
When you use the npx @better-auth/cli generate command, it generates a migration file with "user" table and "user" relations but you cannot create a user table in postgres, it's reserved word. But when trying to log in, it still looks for the user table, dismissing the remapping to "users" table in auth.ts
user: {
modelName: "users",
this gives me error:
2 replies
BABetter Auth
•Created by King Alastor on 2/3/2025 in #help
Argument `token` is missing.
Hey, has anyone managet to get better-auth working with Prisma? i'm migrating from Authjs (next auth) to better-auth and i used the npx @better-auth/cli generate as well to create the schema and everything but i keep getting this error, even though database is completely synced and prisma client is generated:
7 replies
PPrisma
•Created by King Alastor on 1/23/2025 in #help-and-questions
Misleading error message: ERR_INVALID_ARG_TYPE
So i was trying to use raw sql but i forgot to account for @map values in my prisma schema so i was trying to update a column with the model name instead of the map name which i should have used in raw sql. However i ran into very weird error. The query itself was pretty simple:
however the error response i got was:
If you try to access a column in SQL IDE that doesn't exist, you get a simple error SQL Error [42703]: ERROR: column "testing" does not exist. I would have expected a similar error message to that if you're trying to update a table/user that doesn't exist. I solved the problem by modifying the table/col names to correct ones but it took me a while to notice that due to the error message implying that the variables i'm trying to pass down were null/undefined which was misleading. I don't really have a question since i solved the issues other than if it's intended or is this something that you'd need to update/fix or did i miss something?
3 replies