mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
ApiKey Authentication cleanup
This commit is contained in:
parent
57fdbe6e08
commit
de607e207b
8 changed files with 48 additions and 45 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue