Skip to content

Commit 3aba75a

Browse files
Permissions pre-warm added. Access denied page added
1 parent a67f9da commit 3aba75a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ApiIntegrationMvc/Program.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ApiIntegrationMvc;
2+
using ApiIntegrationMvc.Middlewares;
23
using CentralizedLogging.Sdk.Extensions;
34
using Microsoft.AspNetCore.Authentication.Cookies;
45
using Microsoft.AspNetCore.Authorization;
@@ -12,6 +13,7 @@
1213
using SharedLibrary.Auth;
1314
using SharedLibrary.Auths;
1415
using SharedLibrary.Cache;
16+
using StackExchange.Redis;
1517
using UserManagement.Sdk.Extensions;
1618

1719

@@ -49,7 +51,7 @@
4951
{
5052
o.LoginPath = "/Account/Login";
5153
o.LogoutPath = "/Account/Logout";
52-
o.AccessDeniedPath = "/Account/Denied";
54+
o.AccessDeniedPath = "/Home/Home/Denied";
5355
// optional:
5456
o.SlidingExpiration = true;
5557
o.ExpireTimeSpan = TimeSpan.FromHours(8);
@@ -80,7 +82,6 @@
8082

8183
builder.Services.AddScoped<IAuthorizationHandler, PermissionHandler>();
8284

83-
8485
var app = builder.Build();
8586
app.UseSerilogRequestLogging(); // structured request logs
8687

@@ -100,6 +101,7 @@
100101
app.UseRouting();
101102

102103
app.UseAuthentication();
104+
app.UseMiddleware<EnsurePermissionsCachedMiddleware>();
103105
app.UseAuthorization();
104106

105107
app.MapControllerRoute(

0 commit comments

Comments
 (0)