@@ -15,13 +15,13 @@ namespace LearningHub.Nhs.WebUI.Controllers
1515 using LearningHub . Nhs . WebUI . Helpers ;
1616 using LearningHub . Nhs . WebUI . Interfaces ;
1717 using LearningHub . Nhs . WebUI . Models ;
18- using Microsoft . ApplicationInsights . AspNetCore ;
1918 using Microsoft . AspNetCore . Authentication ;
2019 using Microsoft . AspNetCore . Authentication . Cookies ;
2120 using Microsoft . AspNetCore . Authorization ;
2221 using Microsoft . AspNetCore . Diagnostics ;
2322 using Microsoft . AspNetCore . Hosting ;
2423 using Microsoft . AspNetCore . Mvc ;
24+ using Microsoft . Extensions . Configuration ;
2525 using Microsoft . Extensions . Logging ;
2626 using Microsoft . Extensions . Options ;
2727 using Microsoft . FeatureManagement ;
@@ -39,6 +39,7 @@ public class HomeController : BaseController
3939 private readonly IDashboardService dashboardService ;
4040 private readonly IContentService contentService ;
4141 private readonly IFeatureManager featureManager ;
42+ private readonly Microsoft . Extensions . Configuration . IConfiguration configuration ;
4243
4344 /// <summary>
4445 /// Initializes a new instance of the <see cref="HomeController"/> class.
@@ -53,6 +54,7 @@ public class HomeController : BaseController
5354 /// <param name="dashboardService">Dashboard service.</param>
5455 /// <param name="contentService">Content service.</param>
5556 /// <param name="featureManager"> featureManager.</param>
57+ /// <param name="configuration"> config.</param>
5658 public HomeController (
5759 IHttpClientFactory httpClientFactory ,
5860 IWebHostEnvironment hostingEnvironment ,
@@ -63,7 +65,8 @@ public HomeController(
6365 LearningHubAuthServiceConfig authConfig ,
6466 IDashboardService dashboardService ,
6567 IContentService contentService ,
66- IFeatureManager featureManager )
68+ IFeatureManager featureManager ,
69+ Microsoft . Extensions . Configuration . IConfiguration configuration )
6770 : base ( hostingEnvironment , httpClientFactory , logger , settings . Value )
6871 {
6972 this . authConfig = authConfig ;
@@ -72,6 +75,7 @@ public HomeController(
7275 this . dashboardService = dashboardService ;
7376 this . contentService = contentService ;
7477 this . featureManager = featureManager ;
78+ this . configuration = configuration ;
7579 }
7680
7781 /// <summary>
@@ -168,6 +172,9 @@ public IActionResult Error(int? httpStatusCode)
168172 {
169173 if ( originalPath == "/TooManyRequests" )
170174 {
175+ this . ViewBag . Period = this . configuration [ "IpRateLimiting:GeneralRules:0:Period" ] ;
176+ this . ViewBag . Limit = this . configuration [ "IpRateLimiting:GeneralRules:0:Limit" ] ;
177+
171178 return this . View ( "TooManyRequests" ) ;
172179 }
173180 else
0 commit comments