mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 10:30:47 +01:00
Greenfield: allow delete user by email too (#5372)
This commit is contained in:
parent
1d210eb6e3
commit
f20e6d3768
1 changed files with 4 additions and 4 deletions
|
@ -216,12 +216,12 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
return CreatedAtAction(string.Empty, model);
|
return CreatedAtAction(string.Empty, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("~/api/v1/users/{userId}")]
|
[HttpDelete("~/api/v1/users/{idOrEmail}")]
|
||||||
[Authorize(Policy = Policies.CanModifyServerSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
[Authorize(Policy = Policies.CanModifyServerSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||||
public async Task<IActionResult> DeleteUser(string userId)
|
public async Task<IActionResult> DeleteUser(string idOrEmail)
|
||||||
{
|
{
|
||||||
var user = await _userManager.FindByIdAsync(userId);
|
var user = await _userManager.FindByIdOrEmail(idOrEmail);
|
||||||
if (user == null)
|
if (user is null)
|
||||||
{
|
{
|
||||||
return this.UserNotFound();
|
return this.UserNotFound();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue