Ensure initial user exists before startup wizard completes

Add logic to initialize at least one user if the startup wizard is not completed, both during application startup and in the startup user API. After user creation, reload the user entity with all related navigation properties to ensure the in-memory user object is fully populated. Also update build and publish metadata files.
This commit is contained in:
2026-02-23 15:42:19 -05:00
parent f833f0ceeb
commit 534b0cde91
43 changed files with 25 additions and 4 deletions
@@ -599,6 +599,14 @@ namespace Emby.Server.Implementations
SetStaticProperties();
FindParts();
// Ensure at least one user exists for the startup wizard
var userManager = Resolve<IUserManager>();
if (!ConfigurationManager.Configuration.IsStartupWizardCompleted)
{
Logger.LogInformation("Startup wizard not completed, ensuring initial user exists");
await userManager.InitializeAsync().ConfigureAwait(false);
}
}
private X509Certificate2 GetCertificate(string path, string password)