aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-02-05 18:32:13 +0000
committerJPVenson <github@jpb.email>2025-02-05 18:32:13 +0000
commitdfdef511a5b855ee4e4f079236ff43cb508958d5 (patch)
treedb2c5d8cfe13817b165c1d24495947d98c25f670 /tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs
parent078587d232ccbfdf6e08c6f1a6435e4e397e4bdc (diff)
parent00b66a06eac4d1331d59a6a9b7de3e99088ebaa9 (diff)
Merge remote-tracking branch 'jellyfinorigin/master' into feature/pgsql_provider
Diffstat (limited to 'tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs')
-rw-r--r--tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs b/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs
index 99f10583c..6b3afc935 100644
--- a/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs
+++ b/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs
@@ -101,6 +101,7 @@ namespace Jellyfin.Api.Tests.Auth
var authorizationInfo = SetupUser();
var authenticateResult = await _sut.AuthenticateAsync();
+ Assert.NotNull(authorizationInfo.User);
Assert.True(authenticateResult.Principal?.HasClaim(ClaimTypes.Name, authorizationInfo.User.Username));
}
@@ -112,6 +113,7 @@ namespace Jellyfin.Api.Tests.Auth
var authorizationInfo = SetupUser(isAdmin);
var authenticateResult = await _sut.AuthenticateAsync();
+ Assert.NotNull(authorizationInfo.User);
var expectedRole = authorizationInfo.User.HasPermission(PermissionKind.IsAdministrator) ? UserRoles.Administrator : UserRoles.User;
Assert.True(authenticateResult.Principal?.HasClaim(ClaimTypes.Role, expectedRole));
}
@@ -133,7 +135,6 @@ namespace Jellyfin.Api.Tests.Auth
authorizationInfo.User.AddDefaultPreferences();
authorizationInfo.User.SetPermission(PermissionKind.IsAdministrator, isAdmin);
authorizationInfo.IsApiKey = false;
- authorizationInfo.HasToken = true;
authorizationInfo.Token = "fake-token";
_jellyfinAuthServiceMock.Setup(