MongoDB
Fresh install nextjs following docs - And using the following for mongodb
auth.ts
my db instance
index.ts
"mongodb is not supported" when doing generate. "
30 Replies
When siging up
both generate and migrate doesn't work with mongodb
you need to pass the collection instance instead
Something like this
and pass the db to the adpater
Brain fart. OF course. This fixed it - How does it react when adding plugins? That works aswell?
yeah
Just checking in before creating a bug
Payload in packet
add set-active api endpoint
However, in "member" see attached pic - The user is the owenr of it.

this is must be a bug
I'll create a bug on git
GitHub
Organization Plugin · Issue #508 · better-auth/better-auth
Describe the bug "You are not a member of this Organization" when trying to set active org for a user that has the owner role on said org. This is using client.organization.setActive({ or...
wait you need to pass headers to set active org
are you passing headers?
never mind
thought it was
auth.api
callNop
You're calling this on the client right? not on the server
Yes
Pls do ping me here if you find anything thats related to it. The app im doing relies heavily on the org addon 😄
hey, it will be fixed today
Pls let me know what version I will implement it asap.
Sorry!
I changed to use Prisma:
`
Schema looks like
Upon sign up, I get error
NextJS 15 with prisma. How come? What am I missing?
I followed the docs to use prisma.
make sure to generate the schema. this should only happen if
prisma[modelName].findFirst
throws an error.I just updated to 0.8.3 beta 5
npx @better-auth/cli generate
ERROR Failed to initialize database adapter
No other changes have been done. auth.ts db.ts It worked just before I updated 😛
No other changes have been done. auth.ts db.ts It worked just before I updated 😛
use the latest cli
there was a breaking change
How would I get that downloaded?
npx @better-auth/cli@latest generate
if incase this is being cached npx @better-auth/[email protected] generate
Hmm
oh corrected
Huh?
npx @better-auth/cli@latest generate
Funnily it asks me to install the same
Which then goes back to
is better-auth version
0.8.3-beta.5
as well?no, in package.json
well update it to latest as well
Yep. That did solve the issue as seems.
-> Does this fix the orgiinal issue about User orgs not being able to set active as reported on git
yes
Might be a bug again in the orgs plugin! Let me know if I need to file a bug
Returns
But as it seems, according to docs, it should be a string not a object.
The payload is formatted like
If I assign one value to metadata, e'g vatnumber - It works fine