mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
Do not ignore IsAdmin settings when creating a new user via the Users page (Fix #1954)
This commit is contained in:
parent
5131d8d328
commit
32e6643303
1 changed files with 2 additions and 8 deletions
|
@ -99,7 +99,8 @@ namespace BTCPayServer.Controllers
|
|||
{
|
||||
ViewData["AllowIsAdmin"] = _Options.AllowAdminRegistration;
|
||||
ViewData["AllowRequestEmailConfirmation"] = _cssThemeManager.Policies.RequiresConfirmedEmail;
|
||||
|
||||
if (!_Options.AllowAdminRegistration)
|
||||
model.IsAdmin = false;
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
IdentityResult result;
|
||||
|
@ -107,14 +108,7 @@ namespace BTCPayServer.Controllers
|
|||
|
||||
if (!string.IsNullOrEmpty(model.Password))
|
||||
{
|
||||
|
||||
result = await _UserManager.CreateAsync(user, model.Password);
|
||||
|
||||
if (result.Succeeded)
|
||||
{
|
||||
TempData[WellKnownTempData.SuccessMessage] = "Account created";
|
||||
return RedirectToAction(nameof(ListUsers));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue