This commit is contained in:
nicolas.dorier 2020-03-19 13:34:11 +09:00
parent 2105b44610
commit eac33d494a
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
2 changed files with 4 additions and 0 deletions

View file

@ -454,6 +454,7 @@ namespace BTCPayServer.Controllers
if (_Options.DisableRegistration)
{
// Once the admin user has been created lock subsequent user registrations (needs to be disabled for unit tests that require multiple users).
Logs.PayServer.LogInformation("First admin created, disabling subscription (disable-registration is set to true)");
policies.LockSubscription = true;
await _SettingsRepository.UpdateSetting(policies);
}

View file

@ -1,4 +1,5 @@
using System;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading;
@ -7,6 +8,7 @@ using BTCPayServer.Client.Models;
using BTCPayServer.Configuration;
using BTCPayServer.Data;
using BTCPayServer.Events;
using BTCPayServer.Logging;
using BTCPayServer.Security;
using BTCPayServer.Security.APIKeys;
using BTCPayServer.Services;
@ -146,6 +148,7 @@ namespace BTCPayServer.Controllers.RestApi.Users
if (_options.DisableRegistration)
{
// automatically lock subscriptions now that we have our first admin
Logs.PayServer.LogInformation("First admin created, disabling subscription (disable-registration is set to true)");
policies.LockSubscription = true;
await _settingsRepository.UpdateSetting(policies);
}