diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.cs index 788e67bb99..6bc795cb35 100644 --- a/Jellyfin.Api/Controllers/StartupController.cs +++ b/Jellyfin.Api/Controllers/StartupController.cs @@ -142,13 +142,13 @@ public class StartupController : BaseJellyfinApiController return BadRequest("Password must not be empty"); } + await _userManager.UpdateUserAsync(user).ConfigureAwait(false); + if (startupUserDto.Name is not null) { await _userManager.RenameUser(user.Id, user.Username, startupUserDto.Name).ConfigureAwait(false); } - await _userManager.UpdateUserAsync(user).ConfigureAwait(false); - if (!string.IsNullOrEmpty(startupUserDto.Password)) { await _userManager.ChangePassword(user.Id, startupUserDto.Password).ConfigureAwait(false);