Sliding expiration for auth cookie and a little clean up

Closes #2920

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
pull/3207/head
Qstick 2 years ago
parent 37bec3ade0
commit efb9013bad

@ -33,6 +33,7 @@ namespace Lidarr.Http.Authentication
options.AccessDeniedPath = "/login?loginFailed=true";
options.LoginPath = "/login";
options.ExpireTimeSpan = TimeSpan.FromDays(7);
options.SlidingExpiration = true;
})
.AddApiKey("API", options =>
{

@ -15,17 +15,14 @@ namespace Lidarr.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;
}

Loading…
Cancel
Save