[GH-ISSUE #7291] [Feature] Allow users to dismiss expired invitations #19412

Closed
opened 2026-04-15 18:28:33 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @caiotarifa on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7291

Is this suited for github?

  • Yes, this is suited for github

When a user receives an organization invitation that expires, they cannot remove it from their invitation list. The invitation becomes "stuck" in the UI with no available actions.

Currently:

  • acceptInvitation - fails if invitation is expired
  • rejectInvitation - fails if invitation is expired
  • cancelInvitation - only works for organization members who sent the invitation

Describe the solution you'd like

What about adding a method that allows invitation recipients to dismiss expired invitations from their list?

await client.organization.dismissInvitation({ invitationId })

This would:

  • Only work for expired invitations;
  • Remove the invitation from the user's listUserInvitations() results;
  • Give users control over their invitation inbox.

Describe alternatives you've considered

Or, just allow rejectInvitation to work on expired invitations, so users can explicitly reject them even after expiration.

Additional context

Why not stop displaying expired invitations?
Well, because I consider it a usability problem for the invitation to simply "disappear".

Originally created by @caiotarifa on GitHub (Jan 12, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7291 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. When a user receives an organization invitation that expires, they cannot remove it from their invitation list. The invitation becomes "stuck" in the UI with no available actions. Currently: - `acceptInvitation` - fails if invitation is expired - `rejectInvitation` - fails if invitation is expired - `cancelInvitation` - only works for organization members who sent the invitation ### Describe the solution you'd like What about adding a method that allows invitation recipients to dismiss expired invitations from their list? ```javascript await client.organization.dismissInvitation({ invitationId }) ``` This would: - Only work for expired invitations; - Remove the invitation from the user's `listUserInvitations()` results; - Give users control over their invitation inbox. ### Describe alternatives you've considered Or, just allow `rejectInvitation` to work on expired invitations, so users can explicitly reject them even after expiration. ### Additional context **Why not stop displaying expired invitations?** Well, because I consider it a usability problem for the invitation to simply "disappear".
GiteaMirror added the lockedenhancement labels 2026-04-15 18:28:33 -05:00
Author
Owner

@ChetanReddyC commented on GitHub (Jan 12, 2026):

hey @caiotarifa if this feature is valid im taking this!

<!-- gh-comment-id:3738726575 --> @ChetanReddyC commented on GitHub (Jan 12, 2026): hey @caiotarifa if this feature is valid im taking this!
Author
Owner

@ChetanReddyC commented on GitHub (Jan 13, 2026):

Thanks for the update and for the alternative fix @Bekacru

My earlier PR proposed a dedicated dismissInvitation endpoint to keep the semantics explicit (expired + recipient-only) and avoid overloading existing actions, but I completely understand the preference for a minimal API surface and reusing rejectInvitation instead.

The current approach makes sense from a maintenance and backwards-compatibility standpoint. Happy to close my PR in favor of this solution, and thanks for reviewing the issue so quickly!

<!-- gh-comment-id:3742088829 --> @ChetanReddyC commented on GitHub (Jan 13, 2026): Thanks for the update and for the alternative fix @Bekacru My earlier PR proposed a dedicated dismissInvitation endpoint to keep the semantics explicit (expired + recipient-only) and avoid overloading existing actions, but I completely understand the preference for a minimal API surface and reusing rejectInvitation instead. The current approach makes sense from a maintenance and backwards-compatibility standpoint. Happy to close my PR in favor of this solution, and thanks for reviewing the issue so quickly!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19412