[PR #6602] [MERGED] feat(organization): return organization name for invited users #32375

Closed
opened 2026-04-17 23:12:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6602
Author: @GautamBytes
Created: 12/8/2025
Status: Merged
Merged: 12/8/2025
Merged by: @Bekacru

Base: canaryHead: feat/show-org-name-in-invites


📝 Commits (4)

  • a0c3689 feat(organization): include organization name in user invitations list
  • ac093c3 fix: improve test and schema coverage
  • 96ec978 fix: prevent leaking full organization object in invitation list
  • 1988bfd fix(organization): add required fields to listUserInvitations OpenAPI schema

📊 Changes

3 files changed (+81 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/adapter.ts (+12 -2)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+1 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-invites.ts (+68 -0)

📄 Description

Related Issue: #6576

Description

Currently, when a user lists their invitations via listUserInvitations, they only receive the organizationId. This makes it difficult for users to know who invited them without accepting the invitation first.

This PR adds the organizationName to the response object of listUserInvitations.

Implementation Details

  • Adapter (adapter.ts): Updated listUserInvitations to perform a join with the organization table.
  • API (crud-invites.ts): Updated the OpenAPI metadata to reflect that organizationName is now returned.
  • Tests: Updated organization.test.ts to assert that organizationName is defined in the response.

Summary by cubic

Show organization name in user invitations so users can see who invited them before accepting. Addresses #6576 by adding organizationName to listUserInvitations.

  • New Features
    • listUserInvitations now joins organization and returns organizationName only.
    • OpenAPI schema updated with organizationName and required fields.
    • Test updated to assert organizationName.

Written for commit 1988bfdc1c. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6602 **Author:** [@GautamBytes](https://github.com/GautamBytes) **Created:** 12/8/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/show-org-name-in-invites` --- ### 📝 Commits (4) - [`a0c3689`](https://github.com/better-auth/better-auth/commit/a0c3689cfa8e930e1dd53458c854c6cda1d587af) feat(organization): include organization name in user invitations list - [`ac093c3`](https://github.com/better-auth/better-auth/commit/ac093c3b12e8cfa0a70fb02596891b39f16f2e76) fix: improve test and schema coverage - [`96ec978`](https://github.com/better-auth/better-auth/commit/96ec978259253de2d0ebf1d90cb002eb4a9bb094) fix: prevent leaking full organization object in invitation list - [`1988bfd`](https://github.com/better-auth/better-auth/commit/1988bfdc1c5665c83fb02191f5aedeb57977b43d) fix(organization): add required fields to listUserInvitations OpenAPI schema ### 📊 Changes **3 files changed** (+81 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+12 -2) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+1 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-invites.ts` (+68 -0) </details> ### 📄 Description Related Issue: #6576 **Description** ----- Currently, when a user lists their invitations via listUserInvitations, they only receive the organizationId. This makes it difficult for users to know who invited them without accepting the invitation first. This PR adds the organizationName to the response object of listUserInvitations. **Implementation Details** - Adapter (adapter.ts): Updated listUserInvitations to perform a join with the organization table. - API (crud-invites.ts): Updated the OpenAPI metadata to reflect that organizationName is now returned. - Tests: Updated organization.test.ts to assert that organizationName is defined in the response. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Show organization name in user invitations so users can see who invited them before accepting. Addresses #6576 by adding organizationName to listUserInvitations. - **New Features** - listUserInvitations now joins organization and returns organizationName only. - OpenAPI schema updated with organizationName and required fields. - Test updated to assert organizationName. <sup>Written for commit 1988bfdc1c5665c83fb02191f5aedeb57977b43d. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 23:12:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#32375