diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-09-03 19:17:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-03 19:17:13 +0200 |
| commit | fb5385f1df55c7a2ee35981ac138cee6c62c903d (patch) | |
| tree | 8ca7b09583a1195e507d347bcbddbabb039f47fc /Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | |
| parent | 95ca1d54876e928dc654736ff5a279728c0f9ed0 (diff) | |
| parent | ff9d14c8119f6cf77f21e4ebcc97c5580725b882 (diff) | |
Merge pull request #6201 from barronpm/authenticationdb-efcore
Migrate Authentication DB to EF Core
Diffstat (limited to 'Jellyfin.Api/Auth/CustomAuthenticationHandler.cs')
| -rw-r--r-- | Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs index c56233794..369e846ae 100644 --- a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs +++ b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs @@ -40,11 +40,11 @@ namespace Jellyfin.Api.Auth } /// <inheritdoc /> - protected override Task<AuthenticateResult> HandleAuthenticateAsync() + protected override async Task<AuthenticateResult> HandleAuthenticateAsync() { try { - var authorizationInfo = _authService.Authenticate(Request); + var authorizationInfo = await _authService.Authenticate(Request).ConfigureAwait(false); var role = UserRoles.User; if (authorizationInfo.IsApiKey || authorizationInfo.User.HasPermission(PermissionKind.IsAdministrator)) { @@ -68,16 +68,16 @@ namespace Jellyfin.Api.Auth var principal = new ClaimsPrincipal(identity); var ticket = new AuthenticationTicket(principal, Scheme.Name); - return Task.FromResult(AuthenticateResult.Success(ticket)); + return AuthenticateResult.Success(ticket); } catch (AuthenticationException ex) { _logger.LogDebug(ex, "Error authenticating with {Handler}", nameof(CustomAuthenticationHandler)); - return Task.FromResult(AuthenticateResult.NoResult()); + return AuthenticateResult.NoResult(); } catch (SecurityException ex) { - return Task.FromResult(AuthenticateResult.Fail(ex)); + return AuthenticateResult.Fail(ex); } } } |
