diff --git a/src/Radarr.Http/Authentication/AuthenticationBuilderExtensions.cs b/src/Radarr.Http/Authentication/AuthenticationBuilderExtensions.cs index 4ad49f797..c0d11e4d8 100644 --- a/src/Radarr.Http/Authentication/AuthenticationBuilderExtensions.cs +++ b/src/Radarr.Http/Authentication/AuthenticationBuilderExtensions.cs @@ -33,6 +33,7 @@ namespace Radarr.Http.Authentication options.AccessDeniedPath = "/login?loginFailed=true"; options.LoginPath = "/login"; options.ExpireTimeSpan = TimeSpan.FromDays(7); + options.SlidingExpiration = true; }) .AddApiKey("API", options => { diff --git a/src/Radarr.Http/Authentication/AuthenticationService.cs b/src/Radarr.Http/Authentication/AuthenticationService.cs index 46cc61b48..f43a70cde 100644 --- a/src/Radarr.Http/Authentication/AuthenticationService.cs +++ b/src/Radarr.Http/Authentication/AuthenticationService.cs @@ -1,5 +1,8 @@ +using System; +using System.Net; using Microsoft.AspNetCore.Http; using NLog; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Authentication; using NzbDrone.Core.Configuration; using Radarr.Http.Extensions; @@ -15,17 +18,14 @@ namespace Radarr.Http.Authentication public class AuthenticationService : IAuthenticationService { - private const string AnonymousUser = "Anonymous"; private static readonly Logger _authLogger = LogManager.GetLogger("Auth"); private readonly IUserService _userService; - private static string API_KEY; private static AuthenticationType AUTH_METHOD; public AuthenticationService(IConfigFileProvider configFileProvider, IUserService userService) { _userService = userService; - API_KEY = configFileProvider.ApiKey; AUTH_METHOD = configFileProvider.AuthenticationMethod; }