diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-06-09 14:29:52 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-09 14:29:52 +0900 |
| commit | b3f8928fbb9cada0eb58b9f3cf29a87ba57cd205 (patch) | |
| tree | 2a0304b9c579198f150227fba6e2d86203ceaff4 /Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | |
| parent | 26f937c36966f9f1636c552292c3affeb8a8082d (diff) | |
| parent | 6be862545ae76eb454b91601f08745e7b46dcd28 (diff) | |
Merge pull request #3218 from crobibero/api-cors
Enable CORS and Authentation
Diffstat (limited to 'Jellyfin.Api/Auth/CustomAuthenticationHandler.cs')
| -rw-r--r-- | Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs index 26f7d9d2d..a0c9c3f5a 100644 --- a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs +++ b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs @@ -37,13 +37,20 @@ namespace Jellyfin.Api.Auth /// <inheritdoc /> protected override Task<AuthenticateResult> HandleAuthenticateAsync() { - var authenticatedAttribute = new AuthenticatedAttribute(); + var authenticatedAttribute = new AuthenticatedAttribute + { + IgnoreLegacyAuth = true + }; + try { var user = _authService.Authenticate(Request, authenticatedAttribute); if (user == null) { - return Task.FromResult(AuthenticateResult.Fail("Invalid user")); + return Task.FromResult(AuthenticateResult.NoResult()); + // TODO return when legacy API is removed. + // Don't spam the log with "Invalid User" + // return Task.FromResult(AuthenticateResult.Fail("Invalid user")); } var claims = new[] |
