aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/QuickConnectController.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2022-10-07 07:49:46 +0200
committerGitHub <noreply@github.com>2022-10-07 07:49:46 +0200
commit803972a76f6f8eb590b2de06662f7e83ce40273d (patch)
treedd72f47907390a7a88373d4cc7510d602ed2d556 /Jellyfin.Api/Controllers/QuickConnectController.cs
parent927fe33d3a0ec7f9e0fb568cfd423c6e8b966c9d (diff)
parent6afc9110439c3c5345beb9a6bac1968ee4dedce8 (diff)
Merge pull request #8500 from cvium/fix_authcontext_usage
Diffstat (limited to 'Jellyfin.Api/Controllers/QuickConnectController.cs')
-rw-r--r--Jellyfin.Api/Controllers/QuickConnectController.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/QuickConnectController.cs b/Jellyfin.Api/Controllers/QuickConnectController.cs
index 1df26355f..77d88475f 100644
--- a/Jellyfin.Api/Controllers/QuickConnectController.cs
+++ b/Jellyfin.Api/Controllers/QuickConnectController.cs
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Authentication;
@@ -104,15 +105,15 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public async Task<ActionResult<bool>> AuthorizeQuickConnect([FromQuery, Required] string code)
{
- var userId = ClaimHelpers.GetUserId(Request.HttpContext.User);
- if (!userId.HasValue)
+ var userId = User.GetUserId();
+ if (userId.Equals(default))
{
return StatusCode(StatusCodes.Status403Forbidden, "Unknown user id");
}
try
{
- return await _quickConnect.AuthorizeRequest(userId.Value, code).ConfigureAwait(false);
+ return await _quickConnect.AuthorizeRequest(userId, code).ConfigureAwait(false);
}
catch (AuthenticationException)
{