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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user