cancelPendingInvitationsOnReInvite is not true by default and the docs say so #1436

Closed
opened 2026-03-13 08:40:02 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @AlexMenor on GitHub (Jun 28, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Instantiate the plugin without setting cancelPendingInvitationsOnReInvite to true, it will not cancel pending invitations on reinvite by default

Current vs. Expected behavior

The docs say (https://www.better-auth.com/docs/plugins/organization#options) that it's true by default

What version of Better Auth are you using?

1.2.8

Provide environment information

n/a

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @AlexMenor on GitHub (Jun 28, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Instantiate the plugin without setting cancelPendingInvitationsOnReInvite to true, it will not cancel pending invitations on reinvite by default ### Current vs. Expected behavior The docs say (https://www.better-auth.com/docs/plugins/organization#options) that it's true by default ### What version of Better Auth are you using? 1.2.8 ### Provide environment information ```bash n/a ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the documentation label 2026-03-13 08:40:02 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 28, 2025):

You're right—there's a mismatch here. The code sets cancelPendingInvitationsOnReInvite to false by default, but the documentation says it defaults to true. This means if you don't explicitly set it, pending invitations won't be canceled on re-invite, which is different from what the docs suggest. To avoid surprises, set cancelPendingInvitationsOnReInvite to your preferred value in your config. It would be good for the maintainers to align the code and docs so the default is clear to everyone.
See code default | See docs claim

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 28, 2025): <!-- Answer --> You're right—there's a mismatch here. The code sets cancelPendingInvitationsOnReInvite to false by default, but the documentation says it defaults to true. This means if you don't explicitly set it, pending invitations won't be canceled on re-invite, which is different from what the docs suggest. To avoid surprises, set cancelPendingInvitationsOnReInvite to your preferred value in your config. It would be good for the maintainers to align the code and docs so the default is clear to everyone. [See code default](https://github.com/better-auth/better-auth/blob/e7eed8c848740fc22dc12e1b82cad8a42155249e/packages/better-auth/src/plugins/organization/index.ts) | [See docs claim](https://github.com/better-auth/better-auth/pull/2308) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/54920200-b32f-4319-bec6-e914b29acf37?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3209)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1436