aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/StartupController.cs
diff options
context:
space:
mode:
authorAnthony Lavado <anthony@lavado.ca>2020-06-14 22:50:49 -0400
committerGitHub <noreply@github.com>2020-06-14 22:50:49 -0400
commitcf9223b8cb2f1ebccf20cb1dcd99d19b78cf3e61 (patch)
tree95ec837fa654622732ba950859190bb3a16b8619 /Jellyfin.Api/Controllers/StartupController.cs
parente2b2f74b47cc1d281c0819795b83f8d49d1f3b09 (diff)
parent524243a9340bfccd2c9ae708be70a5e49f5f53f1 (diff)
Merge pull request #3340 from crobibero/api-migration-merge
Merge master into api-migration
Diffstat (limited to 'Jellyfin.Api/Controllers/StartupController.cs')
-rw-r--r--Jellyfin.Api/Controllers/StartupController.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.cs
index aae066e0e..d96b0f993 100644
--- a/Jellyfin.Api/Controllers/StartupController.cs
+++ b/Jellyfin.Api/Controllers/StartupController.cs
@@ -113,8 +113,14 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<StartupUserDto> GetFirstUser()
{
+ // TODO: Remove this method when startup wizard no longer requires an existing user.
+ _userManager.Initialize();
var user = _userManager.Users.First();
- return new StartupUserDto { Name = user.Name, Password = user.Password };
+ return new StartupUserDto
+ {
+ Name = user.Username,
+ Password = user.Password
+ };
}
/// <summary>
@@ -132,9 +138,9 @@ namespace Jellyfin.Api.Controllers
{
var user = _userManager.Users.First();
- user.Name = startupUserDto.Name;
+ user.Username = startupUserDto.Name;
- _userManager.UpdateUser(user);
+ await _userManager.UpdateUserAsync(user).ConfigureAwait(false);
if (!string.IsNullOrEmpty(startupUserDto.Password))
{