[PR #4371] [MERGED] feat(admin): /admin/update-user role as array #30939

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4371
Author: @alliefitter
Created: 9/2/2025
Status: Merged
Merged: 9/3/2025
Merged by: @himself65

Base: canaryHead: feat/admin-plugin-update-user-array-of-roles


📝 Commits (1)

  • ae51c11 feat(admin): /admin/update-user does not handle role as an array of

📊 Changes

2 files changed (+5 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/admin/admin.test.ts (+2 -0)
📝 packages/better-auth/src/plugins/admin/admin.ts (+3 -0)

📄 Description

/admin/update-user does not handle role as an array of roles like the other admin endpoints do. This PR handles them properly. From what I've been able to find, this endpoint was skipped #1907.


Summary by cubic

/admin/update-user now accepts role as an array, matching the other admin endpoints. We parse roles before updating so they’re stored consistently.

  • Bug Fixes
    • Parse role arrays in update-user using parseRoles.
    • Added a test to ensure ["member","user"] stores as "member,user".

🔄 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/4371 **Author:** [@alliefitter](https://github.com/alliefitter) **Created:** 9/2/2025 **Status:** ✅ Merged **Merged:** 9/3/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/admin-plugin-update-user-array-of-roles` --- ### 📝 Commits (1) - [`ae51c11`](https://github.com/better-auth/better-auth/commit/ae51c11a30e9880ffd7d0ffb23484bc49cd27581) feat(admin): /admin/update-user does not handle role as an array of ### 📊 Changes **2 files changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/admin/admin.test.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+3 -0) </details> ### 📄 Description /admin/update-user does not handle role as an array of roles like the other admin endpoints do. This PR handles them properly. From what I've been able to find, this endpoint was skipped #1907. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic /admin/update-user now accepts role as an array, matching the other admin endpoints. We parse roles before updating so they’re stored consistently. - **Bug Fixes** - Parse role arrays in update-user using parseRoles. - Added a test to ensure ["member","user"] stores as "member,user". <!-- 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 21:55:15 -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#30939