mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
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:
@@ -153,6 +153,10 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
await _userManager.AddToRoleAsync(user, Roles.ServerAdmin);
|
await _userManager.AddToRoleAsync(user, Roles.ServerAdmin);
|
||||||
if (!anyAdmin)
|
if (!anyAdmin)
|
||||||
{
|
{
|
||||||
|
var settings = await _settingsRepository.GetSettingAsync<ThemeSettings>();
|
||||||
|
settings.FirstRun = false;
|
||||||
|
await _settingsRepository.UpdateSetting(settings);
|
||||||
|
|
||||||
await _settingsRepository.FirstAdminRegistered(policies, _options.UpdateUrl != null, _options.DisableRegistration);
|
await _settingsRepository.FirstAdminRegistered(policies, _options.UpdateUrl != null, _options.DisableRegistration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user