Why im getting error : The field "identifier" does not exist in the "verification" schema. ?
I have created separate schema files,
and im passing all schema in betterAuth()
When i click on login button its showing error in terminal
also i have migrated all the schema.
i have made one change in all the schema since user schema i already created. there for id key im using uuid
since i made change every schema text() to uuid()
Can anyone help me to resolve this?



19 Replies
Here its drizzle kit stuido shows all the columns

can you share your whole auth config?
These are the main files related to drizzle and better-auth







this seems like it should work. maybe try removing the schema object passed to the adapter or pass the 4 tables explicitly, dont destructure it.
Ok let me try this
I just destructured because all the 4 table and schema names same as mentioned in documentation,
yeah I understand just incase.
Yes
I'll try that
Because I checked discord and reddit
No one mentioned this error earlier
Maybe something wrong in my code because i have additional columns and tables
@bekacru i have tried, still same error 😦

I made changes back to text() from uuid() for id key
still same issue 🙂
can you make something reproducible? or if this is open source happy to take a look.
I'll share github link with you
I have shared repo url to you in direct message
Any hint? Why it's making issue
here in your user table
firstName for example is non nullable. better auth doesn't set first name when creating user and
name
field doesn't exist which it'll try to set. there is no password
field on the usre table as well. So first fix those.Can i split name to first and last? And map that? Any provisions available like that?
Maybe one thing you can do if the error still persists initiate a new project and use the cli to generate the schema and make the auth part work without anything additional then move things back after that.
you can map it but you still need the name field
if you add them, you also need to speceifcy you have added those fields in your auth config and you can map the profile in the provider config
Oh ok
Let me try this first 🙂
Thank you
Because error was showing in verification table. So not much bothered about other tables
@bekacru i have just created new project and tried default as it is, its working.
after that every places i changed schema id key type from text to uuid and in auth.ts advanced object id generation made false,
now throwing new error from the verification schema

its working,
deleted database and created again with latest migration
@bekacru found one issue.
if all the schema is in root folder which is default generated auth-schema.ts then everything working fine.
if i split schema into multiple files then error is getting
in each schema i made it as default export.
now everything working fine
I implemented google signin button
one more thing noticed.
Just clicked google login button and onthing happend in ui.
i can see POST /api/auth/sign-in/social 200 in 1297ms in terminal and 1 row created in verification table.
when i click again google login button it redirects to choose account

This issue also resolved 🙂