From 5851cbfdfea2a230c8a35e008cc970915d3dee82 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Thu, 24 Jul 2025 21:57:00 -0700 Subject: [PATCH] remove autorenew feature as it wont work --- src/Server/Program.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Server/Program.cs b/src/Server/Program.cs index 671b512..17a5156 100755 --- a/src/Server/Program.cs +++ b/src/Server/Program.cs @@ -87,20 +87,6 @@ builder.Services.AddAuthentication(options => { OnMessageReceived = context => { context.Token = context.Request.Cookies[AuthJWT.TokenName]; return Task.CompletedTask; - }, - OnTokenValidated = context => { - var jwtToken = context.SecurityToken as JwtSecurityToken; - if (jwtToken != null) { - var exp = jwtToken.ValidTo; - var now = DateTime.UtcNow; - if ((exp - now) < TimeSpan.FromDays(3)) { - int accountID = Convert.ToInt32(context.Principal?.FindFirst(ClaimTypes.NameIdentifier)?.Value); - bool isPersistent = bool.Parse(context.Principal?.FindFirst(ClaimTypes.IsPersistent)?.Value); - var newJWT = AuthJWT.GenereateJWTToken(accountID, isPersistent); - AuthJWT.SignIn(context.HttpContext.Response, isPersistent, newJWT); - } - } - return Task.CompletedTask; } }; });