API: Fix behaviour after first admin signup (#2150)

Without updating the `FirstRun` setting it is not possible to login after signing up via the API. Otherwise the `HomeController.Index` action always redirects to the Registration page.
This commit is contained in:
Dennis Reimann 2020-12-17 12:27:01 +01:00 committed by GitHub
parent 5f46b48d45
commit e48d18279c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,6 +153,10 @@ namespace BTCPayServer.Controllers.GreenField
await _userManager.AddToRoleAsync(user, Roles.ServerAdmin);
if (!anyAdmin)
{
var settings = await _settingsRepository.GetSettingAsync<ThemeSettings>();
settings.FirstRun = false;
await _settingsRepository.UpdateSetting(settings);
await _settingsRepository.FirstAdminRegistered(policies, _options.UpdateUrl != null, _options.DisableRegistration);
}
}