[Organizations] usePlural doesn't work

Hey guys. Im facing this issue and not sure if the problem is on my side. When I use custom model names for Organization plugin like this:
plugins: [
organization({
schema: {
invitation: {
modelName: 'organization_invitations'
},
member: {
modelName: 'organization_members'
},
}
}),
]
plugins: [
organization({
schema: {
invitation: {
modelName: 'organization_invitations'
},
member: {
modelName: 'organization_members'
},
}
}),
]
i get the following error:
Error updating user: [BetterAuthError: [# Drizzle Adapter]: The model "organization_member" was not found in the schema object. Please pass the schema directly to the adapter options.] {
cause: undefined
}
Error updating user: [BetterAuthError: [# Drizzle Adapter]: The model "organization_member" was not found in the schema object. Please pass the schema directly to the adapter options.] {
cause: undefined
}
Packages - drizzle-kit@0.31.1 - @better-auth/cli@1.2.9 - better-auth@1.2.9 In this Github Issue i provided mode details and some investigation info - https://github.com/better-auth/better-auth/issues/3069
3 Replies
<DxD/>
<DxD/>3mo ago
i have same problem
Better Auth
Better Auth3mo ago
Hi there! I see you mentioned you’re encountering a similar problem. Could you please provide a bit more detail on what you're experiencing? There have been various issues reported recently—some involve configuration file paths [1], CLI behavior in monorepo setups [11], or even duplicate cookie errors in Expo environments [16]. Let me know which one fits your case, and I’ll do my best to help! Sources: 1. Better Auth's own configuration file 11. better-auth cli not working in monorepo 16. [Bug] Duplicate cookies causing "Invalid Base64 character" error with @better-auth/expo
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
Better Auth's own configuration file · Issue #2980 · better-auth/...
Is this suited for github? Yes, this is suited for github Is your feature request related to a problem? Please describe. Currently, it&#39;s not possible to specify the path to the auth.js file. By...
GitHub
better-auth cli not working in monorepo · Issue #794 · better-au...
Is your feature request related to a problem? Please describe. I am always frustrated when using better-auth in monorepo cause the cli doesn&#39;t recognise the auth.ts file which is annoying Descr...
crthub
crthubOP3mo ago
I went through the suggested sources, but they are not relevant to the issue I faced. It seems like Organizations plugin failes to manage custom model names. In the GH Issue I mentioned in the post, I referenced to the potential place where the issue happens. Please let me know if I can provide more details to continue the investigation. I found something. Please, take a look at this comment - https://github.com/better-auth/better-auth/issues/3069#issuecomment-2985270520

Did you find this page helpful?