[PR #7735] fix(organization): sync members role if the role name was changed #24423

Open
opened 2026-04-15 22:21:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7735
Author: @bytaesu
Created: 2/1/2026
Status: 🔄 Open

Base: mainHead: 2026-02-01/fix/org-update-role-sync-members


📝 Commits (4)

  • f1c1585 fix: sync members role if the role name was changed
  • f3102bb fix: add updateOrgRole endpoint to atomListners
  • 6256981 fix: handle multiple roles case
  • 2717b40 fix: handle pending invitations

📊 Changes

3 files changed (+420 additions, -3 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/client.ts (+8 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-access-control.test.ts (+262 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-access-control.ts (+150 -1)

📄 Description


Summary by cubic

Renaming an organization role now automatically updates all member records and pending invitations using that role, including multi‑role cases, keeping access control consistent. The client also reacts to role updates so active member and role state stay in sync. Addresses #7727.

  • Bug Fixes
    • UpdateOrgRole cascades the new role name to members in the org, including multi‑role members.
    • Pending invitations are updated to the new role name, including multi‑role invites.
    • Client listeners watch /organization/update-role to refresh active member and role signals.
    • Added tests for role rename updates for members and invitations.

Written for commit 2717b40288. Summary will update 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/7735 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `2026-02-01/fix/org-update-role-sync-members` --- ### 📝 Commits (4) - [`f1c1585`](https://github.com/better-auth/better-auth/commit/f1c1585b7c0f8d16946771d611608191fe175f94) fix: sync members role if the role name was changed - [`f3102bb`](https://github.com/better-auth/better-auth/commit/f3102bb2579516e15987f988789f95b1e08cedad) fix: add updateOrgRole endpoint to atomListners - [`6256981`](https://github.com/better-auth/better-auth/commit/625698175b50489e8677901b197ae55f8d80cf21) fix: handle multiple roles case - [`2717b40`](https://github.com/better-auth/better-auth/commit/2717b40288a46bbc67405d138332e02e373c62ba) fix: handle pending invitations ### 📊 Changes **3 files changed** (+420 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/client.ts` (+8 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-access-control.test.ts` (+262 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-access-control.ts` (+150 -1) </details> ### 📄 Description - Closes #7727 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Renaming an organization role now automatically updates all member records and pending invitations using that role, including multi‑role cases, keeping access control consistent. The client also reacts to role updates so active member and role state stay in sync. Addresses #7727. - **Bug Fixes** - UpdateOrgRole cascades the new role name to members in the org, including multi‑role members. - Pending invitations are updated to the new role name, including multi‑role invites. - Client listeners watch /organization/update-role to refresh active member and role signals. - Added tests for role rename updates for members and invitations. <sup>Written for commit 2717b40288a46bbc67405d138332e02e373c62ba. Summary will update 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-15 22:21:49 -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#24423