Ver Fonte

Added password as an API field to the Startup/User Service

Justin Suess há 6 anos atrás
pai
commit
f06b9a14f3
1 ficheiros alterados com 6 adições e 1 exclusões
  1. 6 1
      MediaBrowser.Api/StartupWizardService.cs

+ 6 - 1
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