[PR #3271] [MERGED] fix(admin): throw an error if user id in /remove-user is invalid #4729

Closed
opened 2026-03-13 11:57:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3271
Author: @ping-maxwell
Created: 7/5/2025
Status: Merged
Merged: 7/6/2025
Merged by: @Bekacru

Base: mainHead: fix/admin/remove-user-throw-on-invalid-id


📝 Commits (2)

  • 493e83b fix(admin): Should throw an error if the user id in /remove-user is invalid
  • 72d3444 chore: lint

📊 Changes

1 file changed (+10 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/admin/admin.ts (+10 -0)

📄 Description

Right now if the user id is faked it still returns success: true. This shouldn't be the case, we should return an error if the user id is invalid.


🔄 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/3271 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 7/5/2025 **Status:** ✅ Merged **Merged:** 7/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/admin/remove-user-throw-on-invalid-id` --- ### 📝 Commits (2) - [`493e83b`](https://github.com/better-auth/better-auth/commit/493e83beda27e5c1216ba10701b6cd9698e2e3ec) fix(admin): Should throw an error if the user id in `/remove-user` is invalid - [`72d3444`](https://github.com/better-auth/better-auth/commit/72d3444b690b929a5f195d861a3a398b6d2f23bf) chore: lint ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+10 -0) </details> ### 📄 Description Right now if the user id is faked it still returns `success: true`. This shouldn't be the case, we should return an error if the user id is invalid. --- <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-03-13 11:57:44 -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#4729