mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
ApiKey Authentication cleanup
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
using Nancy;
|
||||
using Nancy.Authentication.Basic;
|
||||
using Nancy.Bootstrapper;
|
||||
using NzbDrone.Api.Extensions;
|
||||
using NzbDrone.Api.Extensions.Pipelines;
|
||||
|
||||
namespace NzbDrone.Api.Authentication
|
||||
{
|
||||
public interface IEnableBasicAuthInNancy
|
||||
{
|
||||
void Register(IPipelines pipelines);
|
||||
}
|
||||
|
||||
public class EnableBasicAuthInNancy : IEnableBasicAuthInNancy
|
||||
public class EnableBasicAuthInNancy : IRegisterNancyPipeline
|
||||
{
|
||||
private readonly IAuthenticationService _authenticationService;
|
||||
|
||||
@@ -28,7 +25,7 @@ namespace NzbDrone.Api.Authentication
|
||||
{
|
||||
Response response = null;
|
||||
|
||||
if (!context.Request.Path.StartsWith("/api/") &&
|
||||
if (!context.Request.IsApiRequest() &&
|
||||
context.CurrentUser == null &&
|
||||
_authenticationService.Enabled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user