aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Users/UserManager.cs
diff options
context:
space:
mode:
authorMatt Montgomery <33811686+ConfusedPolarBear@users.noreply.github.com>2020-08-12 15:38:07 -0500
committerMatt Montgomery <33811686+ConfusedPolarBear@users.noreply.github.com>2020-08-12 15:38:07 -0500
commit4fa3d3f4f3083a43622d69aa76ae714b7a7aabd7 (patch)
tree4f2e3984788ae0b98c7f49abcd0d60374bfde16b /Jellyfin.Server.Implementations/Users/UserManager.cs
parent31d3b1b83aa356221e8af2f316b58584579207fe (diff)
parent741ab4301c6e7cb4b43da9b03732731efdd648a1 (diff)
Merge remote-tracking branch 'upstream/master' into quickconnect
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/UserManager.cs')
-rw-r--r--Jellyfin.Server.Implementations/Users/UserManager.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs
index eaa6a0a81..11402ee05 100644
--- a/Jellyfin.Server.Implementations/Users/UserManager.cs
+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs
@@ -600,18 +600,13 @@ namespace Jellyfin.Server.Implementations.Users
}
var defaultName = Environment.UserName;
- if (string.IsNullOrWhiteSpace(defaultName))
+ if (string.IsNullOrWhiteSpace(defaultName) || !IsValidUsername(defaultName))
{
defaultName = "MyJellyfinUser";
}
_logger.LogWarning("No users, creating one with username {UserName}", defaultName);
- if (!IsValidUsername(defaultName))
- {
- throw new ArgumentException("Provided username is not valid!", defaultName);
- }
-
var newUser = await CreateUserInternalAsync(defaultName, dbContext).ConfigureAwait(false);
newUser.SetPermission(PermissionKind.IsAdministrator, true);
newUser.SetPermission(PermissionKind.EnableContentDeletion, true);