aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily <JustAMan@users.noreply.github.com>2019-01-29 16:11:44 +0300
committerGitHub <noreply@github.com>2019-01-29 16:11:44 +0300
commit0e2e7311036187342fd33d2eb745df4a6bece3f4 (patch)
tree4c23b675a2b316da772150f74e1d04758aab431a
parent6822975fd35cdf47188a151717274c8b39312975 (diff)
parent12e4c1c7aecb5cd1c8ab86716b3bff89a2690b98 (diff)
Merge pull request #758 from RazeLighter777/master
Add password field to initial setup
-rw-r--r--CONTRIBUTORS.md1
-rw-r--r--MediaBrowser.Api/StartupWizardService.cs9
2 files changed, 9 insertions, 1 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index d918b7b95..eca16ad38 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
diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs
index 5f137d804..3d59b4c9a 100644
--- a/MediaBrowser.Api/StartupWizardService.cs
+++ b/MediaBrowser.Api/StartupWizardService.cs
@@ -102,7 +102,8 @@ namespace MediaBrowser.Api
return new StartupUser
{
Name = user.Name,
- ConnectUserName = user.ConnectUserName
+ ConnectUserName = user.ConnectUserName,
+ Password = user.Password
};
}
@@ -111,8 +112,13 @@ namespace MediaBrowser.Api
var user = _userManager.Users.First();
user.Name = request.Name;
+
_userManager.UpdateUser(user);
+ if (!string.IsNullOrEmpty(request.Password)) {
+ await _userManager.ChangePassword(user, request.Password).ConfigureAwait(false);
+ }
+
var result = new UpdateStartupUserResult();
return result;
@@ -130,6 +136,7 @@ namespace MediaBrowser.Api
{
public string Name { get; set; }
public string ConnectUserName { get; set; }
+ public string Password { get; set; }
}
public class UpdateStartupUserResult