Userbestimmung im Homecontroller gefixed

This commit is contained in:
2025-06-17 20:43:15 +02:00
parent e7d3d03f8a
commit 930e5ba181

View File

@@ -20,10 +20,11 @@ namespace Watcher.Controllers
public async Task<IActionResult> Index()
{
var userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
var preferredUserName = User.FindFirst("preferred_username")?.Value;
var user = await _context.Users
.Where(u => u.PocketId == userId)
.Where(u => u.PreferredUsername == preferredUserName)
.FirstOrDefaultAsync();
var viewModel = new DashboardViewModel