user info page updated

This commit is contained in:
2025-06-21 15:49:23 +02:00
parent cca114719b
commit 6417a48b40
4 changed files with 6 additions and 4 deletions

View File

@@ -90,15 +90,17 @@ public class AuthController : Controller
Console.WriteLine("gefundener User: " + username);
var claims = User.Claims.Select(c => new { c.Type, c.Value }).ToList();
var user = _context.Users.FirstOrDefault(u => u.PreferredUsername == username);
Console.WriteLine(user.Email);
var user = _context.Users.FirstOrDefault(u => u.Username == username);
if (user == null) return NotFound();
var DbProvider = _context.Database.ProviderName;
var mail = user.Email;
var Id = user.Id;
ViewBag.Name = username;
ViewBag.Claims = claims;
ViewBag.Mail = mail;
ViewBag.Id = Id;
return View();
}

View File

@@ -34,11 +34,11 @@
</tr>
<tr>
<th><i class="bi bi-envelope me-1"></i>E-Mail</th>
<td>@(User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")?.Value ?? "Nicht verfügbar")</td>
<td>@(ViewBag.Mail ?? "Nicht verfügbar")</td>
</tr>
<tr>
<th><i class="bi bi-fingerprint me-1"></i>Benutzer-ID</th>
<td>@(User.FindFirst("sub")?.Value ?? "Nicht verfügbar")</td>
<td>@(ViewBag.Id ?? "Nicht verfügbar")</td>
</tr>
<tr>
<th><i class="bi bi-clock-history me-1"></i>Login-Zeit</th>

Binary file not shown.

Binary file not shown.