mirror of
https://github.com/Readarr/Readarr
synced 2025-12-15 04:46:13 +01:00
Sliding expiration for auth cookie and a little clean up
Fixes #1802 (cherry picked from commit 05ee4e644907b7f1e84589465ac9ab1848f5a766)
This commit is contained in:
parent
bcc8370d05
commit
cad5762f31
2 changed files with 1 additions and 3 deletions
|
|
@ -33,6 +33,7 @@ public static AuthenticationBuilder AddAppAuthentication(this IServiceCollection
|
|||
options.AccessDeniedPath = "/login?loginFailed=true";
|
||||
options.LoginPath = "/login";
|
||||
options.ExpireTimeSpan = TimeSpan.FromDays(7);
|
||||
options.SlidingExpiration = true;
|
||||
})
|
||||
.AddApiKey("API", options =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,17 +15,14 @@ public interface IAuthenticationService
|
|||
|
||||
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…
Reference in a new issue