From f06b9a14f3aed913d6154cdfdac74807f412ba30 Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Mon, 28 Jan 2019 17:25:37 -0600 Subject: [PATCH 1/3] Added password as an API field to the Startup/User Service --- MediaBrowser.Api/StartupWizardService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 5f137d804c..f2002a8224 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -8,6 +8,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Net; using MediaBrowser.Model.Services; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Api { @@ -102,7 +103,8 @@ namespace MediaBrowser.Api return new StartupUser { Name = user.Name, - ConnectUserName = user.ConnectUserName + ConnectUserName = user.ConnectUserName, + Password = user.Password }; } @@ -111,7 +113,9 @@ namespace MediaBrowser.Api var user = _userManager.Users.First(); user.Name = request.Name; + _userManager.UpdateUser(user); + await _userManager.ChangePassword(user, request.Password).ConfigureAwait(false); var result = new UpdateStartupUserResult(); @@ -130,6 +134,7 @@ namespace MediaBrowser.Api { public string Name { get; set; } public string ConnectUserName { get; set; } + public string Password { get; set; } } public class UpdateStartupUserResult From 6786dfcabddc73fc36f4ca65d18e05094ce4140f Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Mon, 28 Jan 2019 17:37:20 -0600 Subject: [PATCH 2/3] Made password field non-mandatory upon setup --- MediaBrowser.Api/StartupWizardService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index f2002a8224..3d59b4c9a0 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -8,7 +8,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Net; using MediaBrowser.Model.Services; -using MediaBrowser.Controller.Entities; namespace MediaBrowser.Api { @@ -115,7 +114,10 @@ namespace MediaBrowser.Api user.Name = request.Name; _userManager.UpdateUser(user); - await _userManager.ChangePassword(user, request.Password).ConfigureAwait(false); + + if (!string.IsNullOrEmpty(request.Password)) { + await _userManager.ChangePassword(user, request.Password).ConfigureAwait(false); + } var result = new UpdateStartupUserResult(); From 12e4c1c7aecb5cd1c8ab86716b3bff89a2690b98 Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Mon, 28 Jan 2019 20:11:46 -0600 Subject: [PATCH 3/3] Added RazeLighter777 to the contributors file --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d918b7b95a..eca16ad382 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,6 +16,7 @@ - [wtayl0r](https://github.com/wtayl0r) - [TtheCreator](https://github.com/Tthecreator) - [LogicalPhallacy](https://github.com/LogicalPhallacy/) + - [RazeLighter777](https://github.com/RazeLighter777) # Emby Contributors