diff options
| author | fmarcac <188743521+fmarcac@users.noreply.github.com> | 2026-09-15 11:17:05 -0400 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2026-09-15 11:17:05 -0400 |
| commit | c74ddebd172638399af5585d4a52d73a53dcae62 (patch) | |
| tree | b88f335efc2dd6f722cea776180dd4987489365c /tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs | |
| parent | 57d19b185cc609e9376aef11c2d105343f3cd07a (diff) | |
Backport pull request #18026 from jellyfin/release-12.z
Fix device access revocation not logging out existing sessions
Original-merge: 950c45cf2032a9a8b3bc3abe92adc32f8b5a8ab2
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Cody Robibero <cody@robibe.ro>
Diffstat (limited to 'tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs index c940f92109..e91ebdf1b6 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerUpdateUserTests.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Jellyfin.Data; using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using Jellyfin.Database.Implementations.Enums; using Jellyfin.Database.Implementations.Locking; using Jellyfin.Database.Providers.Sqlite; @@ -17,6 +18,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Cryptography; +using MediaBrowser.Model.Users; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; @@ -120,6 +122,27 @@ public sealed class UserManagerUpdateUserTests : IDisposable } [Fact] + public async Task UpdatePolicyAsync_RaisesOnUserUpdated() + { + var user = await _userManager.CreateUserAsync("policyeventuser"); + + User? updated = null; + _userManager.OnUserUpdated += (_, e) => updated = e.Argument; + + await _userManager.UpdatePolicyAsync( + user.Id, + new UserPolicy + { + EnableAllDevices = false, + AuthenticationProviderId = user.AuthenticationProviderId, + PasswordResetProviderId = user.PasswordResetProviderId + }); + + Assert.NotNull(updated); + Assert.Equal(user.Id, updated.Id); + } + + [Fact] public async Task UpdateUserAsync_AppliesPermissionAndPreferenceChanges() { var user = await _userManager.CreateUserAsync("policyuser"); |
