[PR #5102] [CLOSED] feat(admin): list organizations #22677

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5102
Author: @jslno
Created: 10/5/2025
Status: Closed

Base: canaryHead: feat/admin-list-organizations


📝 Commits (10+)

  • 1f4ce37 feat: add getPlugin helper
  • 13cea8f chore: add minimal adminListOrganizations route
  • 95b4baa refactor: move org plugin check to init
  • 3449516 chore: update client
  • 20e1667 chore: only pass org endpoints when enabled
  • 8ed00ca feat: implement adminListOrganizations endpoint
  • b019eba feat: support additional fields
  • 9681cd6 chore: add tests
  • 577b18b chore: fix typo
  • d6c16c8 docs: add adminListOrganizations endpoint

📊 Changes

9 files changed (+1943 additions, -1389 deletions)

View changed files

📝 docs/content/docs/plugins/admin.mdx (+75 -0)
📝 packages/better-auth/src/plugins/admin/access/statement.ts (+3 -0)
📝 packages/better-auth/src/plugins/admin/admin.test.ts (+244 -0)
📝 packages/better-auth/src/plugins/admin/admin.ts (+1587 -1389)
📝 packages/better-auth/src/plugins/admin/client.ts (+12 -0)
📝 packages/better-auth/src/plugins/admin/error-codes.ts (+2 -0)
📝 packages/better-auth/src/plugins/admin/types.ts (+11 -0)
packages/better-auth/src/utils/get-plugin.ts (+8 -0)
📝 packages/better-auth/src/utils/index.ts (+1 -0)

📄 Description

Related: #5101

TODO

  • Rebase before merging

Summary by cubic

Adds an admin endpoint to list organizations, gated by a new AdminOptions flag. Also introduces a getPlugin helper to access plugins from context. Supports #5101.

  • New Features

    • Admin: minimal adminListOrganizations route to fetch organizations.
    • AdminOptions: organizations.enabled flag to toggle the feature.
    • Utils: getPlugin helper added and exported.
  • Migration

    • Enable with AdminOptions.organizations.enabled = true.

🔄 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/5102 **Author:** [@jslno](https://github.com/jslno) **Created:** 10/5/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/admin-list-organizations` --- ### 📝 Commits (10+) - [`1f4ce37`](https://github.com/better-auth/better-auth/commit/1f4ce37443547b4e52679e75c1b2d53da4a0c021) feat: add getPlugin helper - [`13cea8f`](https://github.com/better-auth/better-auth/commit/13cea8f61a4238eeb67b5d94b7e0ca1b7c174c2a) chore: add minimal adminListOrganizations route - [`95b4baa`](https://github.com/better-auth/better-auth/commit/95b4baa603deaaa2ce393d0721d942ac27b8ca02) refactor: move org plugin check to init - [`3449516`](https://github.com/better-auth/better-auth/commit/3449516ad2c93c5ecbdad1c41e648e3310cd87c5) chore: update client - [`20e1667`](https://github.com/better-auth/better-auth/commit/20e1667bbdd345631a75d69fb1bccb35d72bbd0e) chore: only pass org endpoints when enabled - [`8ed00ca`](https://github.com/better-auth/better-auth/commit/8ed00ca79e877589c4e39d73fd6204464d562529) feat: implement adminListOrganizations endpoint - [`b019eba`](https://github.com/better-auth/better-auth/commit/b019eba588c3375669db265b556c77313e8ddee0) feat: support additional fields - [`9681cd6`](https://github.com/better-auth/better-auth/commit/9681cd6d65b284cac855573049c215d66a671c4d) chore: add tests - [`577b18b`](https://github.com/better-auth/better-auth/commit/577b18b6ff68b8b21642618526c08e72e6c0169d) chore: fix typo - [`d6c16c8`](https://github.com/better-auth/better-auth/commit/d6c16c8e09cfe5f2a91fe4413fdd7b1832285503) docs: add adminListOrganizations endpoint ### 📊 Changes **9 files changed** (+1943 additions, -1389 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/admin.mdx` (+75 -0) 📝 `packages/better-auth/src/plugins/admin/access/statement.ts` (+3 -0) 📝 `packages/better-auth/src/plugins/admin/admin.test.ts` (+244 -0) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+1587 -1389) 📝 `packages/better-auth/src/plugins/admin/client.ts` (+12 -0) 📝 `packages/better-auth/src/plugins/admin/error-codes.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/admin/types.ts` (+11 -0) ➕ `packages/better-auth/src/utils/get-plugin.ts` (+8 -0) 📝 `packages/better-auth/src/utils/index.ts` (+1 -0) </details> ### 📄 Description Related: #5101 #### TODO - [ ] Rebase before merging <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds an admin endpoint to list organizations, gated by a new AdminOptions flag. Also introduces a getPlugin helper to access plugins from context. Supports #5101. - **New Features** - Admin: minimal adminListOrganizations route to fetch organizations. - AdminOptions: organizations.enabled flag to toggle the feature. - Utils: getPlugin helper added and exported. - **Migration** - Enable with AdminOptions.organizations.enabled = true. <!-- 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 21:12:37 -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#22677