From ff9b1e112ed14746ed74dfff1fb4c19efd5502d4 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 19 Apr 2025 12:16:15 +0200 Subject: Add user information settings --- VPNAuth.Server/Pages/Dashboard.cshtml | 57 ++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) (limited to 'VPNAuth.Server/Pages') diff --git a/VPNAuth.Server/Pages/Dashboard.cshtml b/VPNAuth.Server/Pages/Dashboard.cshtml index cb00d9f..38f9c7e 100644 --- a/VPNAuth.Server/Pages/Dashboard.cshtml +++ b/VPNAuth.Server/Pages/Dashboard.cshtml @@ -1,13 +1,20 @@ @page "/" -@using Microsoft.EntityFrameworkCore.ChangeTracking @using VPNAuth.Server @using VPNAuth.Server.Database @{ Layout = null; - + string remoteIp = Request.HttpContext.GetRemoteIpAddress(); - ConfigUser? user = Request.HttpContext.GetUser(); + ConfigUser? configUser = Request.HttpContext.GetUser(); + + UserInformation? dbUser = null; + + if (configUser != null) + { + using var db = new Database(); + dbUser = db.UserInformation.Where(user => user.Sub == configUser!.Username).ToList().FirstOrDefault(); + } } @@ -17,7 +24,7 @@ VPNAuth - Dashboard - @if (user == null) + @if (configUser == null) {

No user detected

} @@ -26,16 +33,52 @@

Dashboard

VPNAuth

-

Hey, @user.Username!

- User settings coming soon... +

Hey, @configUser.Username!

+

User settings

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Username@dbUser?.Sub
+

Your IPs

} + -- cgit v1.2.3