Skip to content

Commit

Permalink
GCS-28: Update session timout to 15mins
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusEnrique committed Nov 14, 2024
1 parent 01c0d87 commit afb939f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ public static void ConfigureApplicationBuilderServices(this IApplicationBuilder
context.Context.Response.Headers[HeaderNames.CacheControl] = $"public, max-age={TimeSpan.FromSeconds(60 * 60 * 24)}";
}
});
app.UseSession();

app.UseCookiePolicy();
app.UseRouting();
app.UseSession();
app.UseResponseCaching();

app.Use(async (context, next) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void ConfigureAuthenticationServices(IServiceCollection services)
OnTokenValidated = context =>
{
var tokenService = context.HttpContext.RequestServices.GetRequiredService<ITokenService>();
context.HttpContext.Session.SetString("UserSession", "Active");
return tokenService.HandleOnTokenValidatedAsync(context);
},
OnAuthenticationFailed = context =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static IServiceCollection ConfigureApplicationServices(this IServiceColle
services.AddSession(s =>
{
s.Cookie.Name = ".GpConnectAppointmentChecker.Session";
s.IdleTimeout = new TimeSpan(0, 30, 0);
s.IdleTimeout = new TimeSpan(0, 15, 0);
s.Cookie.HttpOnly = true;
s.Cookie.IsEssential = true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void ConfigureServices(IServiceCollection services)
authenticationExtensions.ConfigureAuthenticationServices(services);

services.ConfigureLoggingServices(_configuration);
services.ConfigureApplicationServices(_configuration, _webHostEnvironment);
services.ConfigureApplicationServices(_configuration, _webHostEnvironment);
}

public void ConfigureContainer(ContainerBuilder builder)
Expand Down

0 comments on commit afb939f

Please sign in to comment.