aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Users
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-10-21 05:27:18 +0200
committerGitHub <noreply@github.com>2024-10-20 21:27:18 -0600
commit5b696124fc24e183aa62e5132cfba640791e210c (patch)
tree34473b07354ea3a463579bbc6c277333c1d4c143 /Jellyfin.Server.Implementations/Users
parent31382b232d23e7ba8a69359d73b0034d7c66e2f9 (diff)
Add catch to remove cached user if creation fails (#12574)
Diffstat (limited to 'Jellyfin.Server.Implementations/Users')
-rw-r--r--Jellyfin.Server.Implementations/Users/UserManager.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs
index eb4bc2aff..1b6635938 100644
--- a/Jellyfin.Server.Implementations/Users/UserManager.cs
+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs
@@ -201,8 +201,6 @@ namespace Jellyfin.Server.Implementations.Users
user.AddDefaultPermissions();
user.AddDefaultPreferences();
- _users.Add(user.Id, user);
-
return user;
}
@@ -227,6 +225,7 @@ namespace Jellyfin.Server.Implementations.Users
dbContext.Users.Add(newUser);
await dbContext.SaveChangesAsync().ConfigureAwait(false);
+ _users.Add(newUser.Id, newUser);
}
await _eventManager.PublishAsync(new UserCreatedEventArgs(newUser)).ConfigureAwait(false);
@@ -560,6 +559,7 @@ namespace Jellyfin.Server.Implementations.Users
dbContext.Users.Add(newUser);
await dbContext.SaveChangesAsync().ConfigureAwait(false);
+ _users.Add(newUser.Id, newUser);
}
}