Refactor startup user creation and add HomeSection config

Refactored user initialization to always ensure at least one user exists at startup. If no users are present, a default admin user (admin/jellyfin) is created automatically. Updated StartupController endpoints to handle cases where no user exists. Simplified UserManager.InitializeAsync logic. Added HomeSectionConfiguration for EF Core entity mapping. Includes minor project and assembly info updates.
This commit is contained in:
2026-02-23 17:54:53 -05:00
parent 534b0cde91
commit 43cdbf9b35
11 changed files with 78 additions and 29 deletions
@@ -600,13 +600,9 @@ namespace Emby.Server.Implementations
FindParts();
// Ensure at least one user exists for the startup wizard
// Ensure at least one user exists
var userManager = Resolve<IUserManager>();
if (!ConfigurationManager.Configuration.IsStartupWizardCompleted)
{
Logger.LogInformation("Startup wizard not completed, ensuring initial user exists");
await userManager.InitializeAsync().ConfigureAwait(false);
}
await userManager.InitializeAsync().ConfigureAwait(false);
}
private X509Certificate2 GetCertificate(string path, string password)