Skip to content

Commit b4b96d4

Browse files
committed
Add IP from Config
1 parent 8c21c44 commit b4b96d4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/DevBetterWeb.Web/Pages/_MemberLayout.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@using Microsoft.AspNetCore.Http
21
@using Microsoft.AspNetCore.Identity
32
@using DevBetterWeb.Infrastructure.Identity.Data;
3+
@using Microsoft.Extensions.Configuration
44
@inject SignInManager<ApplicationUser> SignInManager
55
@inject UserManager<ApplicationUser> UserManager
6-
@inject IHttpContextAccessor HttpContextAccessor
6+
@inject IConfiguration Configuration
77

88
<!DOCTYPE html>
99
<html lang="en">
@@ -199,7 +199,7 @@
199199
<footer class="sticky-footer bg-white">
200200
<div class="container my-auto">
201201
<div class="copyright text-center my-auto">
202-
<span>Copyright &copy; devBetter @DateTime.Now.Year; All Rights Reserved. @HttpContextAccessor.HttpContext?.Connection?.LocalIpAddress</span>
202+
<span>Copyright &copy; devBetter @DateTime.Now.Year; All Rights Reserved. @Configuration["Hosting:PublicIP"]</span>
203203
</div>
204204
</div>
205205
</footer>

src/DevBetterWeb.Web/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
builder.Services.Configure<StripeOptions>(builder.Configuration.GetSection("StripeOptions"));
5454
builder.Services.Configure<SubscriptionPlanOptions>(builder.Configuration.GetSection("SubscriptionPlanOptions"));
5555
builder.Services.Configure<ApiSettings>(builder.Configuration.GetSection("ApiSettings"));
56-
builder.Services.AddHttpContextAccessor();
5756

5857
// PRODUCTION SERVICES
5958
if (builder.Environment.EnvironmentName.ToLower() == "production")

0 commit comments

Comments
 (0)