Property 'organization' does not exist using mongodb adapter

I'm having an issue with organization plugin using mongodb adapter. organization not working with authClient or auth on server side.
No description
12 Replies
Ping
Ping3mo ago
Can I see both your auth & auth client configs?
rgz
rgzOP3mo ago
import {
adminClient,
inferAdditionalFields,
magicLinkClient,
organizationClient,
passkeyClient,
} from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
import type { auth } from ".";

export const authClient = createAuthClient({
plugins: [
inferAdditionalFields<typeof auth>(),
magicLinkClient(),
organizationClient(),
adminClient(),
passkeyClient(),
],
});

export type AuthClientErrorCodes = typeof authClient.$ERROR_CODES & {
INVALID_INVITATION: string;
};
import {
adminClient,
inferAdditionalFields,
magicLinkClient,
organizationClient,
passkeyClient,
} from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
import type { auth } from ".";

export const authClient = createAuthClient({
plugins: [
inferAdditionalFields<typeof auth>(),
magicLinkClient(),
organizationClient(),
adminClient(),
passkeyClient(),
],
});

export type AuthClientErrorCodes = typeof authClient.$ERROR_CODES & {
INVALID_INVITATION: string;
};
rgz
rgzOP3mo ago
Thank you for responding.
Ping
Ping3mo ago
When you say it does not work, what do you mean? Is there some error?
rgz
rgzOP3mo ago
No description
No description
rgz
rgzOP3mo ago
Not able to access it
Ping
Ping3mo ago
Have you tried reloading ts-server for your editor?
rgz
rgzOP3mo ago
Yeah I did
Ping
Ping3mo ago
It looks like you already written some code using org plugin, was this something that happened out of the blue?
rgz
rgzOP3mo ago
Yes but I haven't touched any of that portion. Looking back at my code I'm just gonna revert last changes and see if I can debug file by file. Yeah still same issues.
Ping
Ping3mo ago
It's very odd, the only thing I can think of is to just delete node_modules and reinstall dependencies to hopefully fix typings.
rgz
rgzOP3mo ago
I ended up duplicating the project and it worked fine afterwards. Not sure exactly what happened.

Did you find this page helpful?