From f20e6d3768f92ad83d841887a2de67f82d15568a Mon Sep 17 00:00:00 2001 From: Andrew Camilleri Date: Tue, 10 Oct 2023 05:26:23 +0200 Subject: [PATCH] Greenfield: allow delete user by email too (#5372) --- .../Controllers/GreenField/GreenfieldUsersController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldUsersController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldUsersController.cs index 31419fbb9..e03d095ae 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldUsersController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldUsersController.cs @@ -216,12 +216,12 @@ namespace BTCPayServer.Controllers.Greenfield return CreatedAtAction(string.Empty, model); } - [HttpDelete("~/api/v1/users/{userId}")] + [HttpDelete("~/api/v1/users/{idOrEmail}")] [Authorize(Policy = Policies.CanModifyServerSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)] - public async Task DeleteUser(string userId) + public async Task DeleteUser(string idOrEmail) { - var user = await _userManager.FindByIdAsync(userId); - if (user == null) + var user = await _userManager.FindByIdOrEmail(idOrEmail); + if (user is null) { return this.UserNotFound(); }