Scaffolded project

This commit is contained in:
Marco 2026-02-18 17:11:13 +01:00
commit 17a561094a
123 changed files with 64313 additions and 0 deletions

View file

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Identity;
using WorkTracker.Data;
namespace WorkTracker.Components.Account;
internal sealed class IdentityUserAccessor(UserManager<ApplicationUser> userManager, IdentityRedirectManager redirectManager)
{
public async Task<ApplicationUser> GetRequiredUserAsync(HttpContext context)
{
var user = await userManager.GetUserAsync(context.User);
if (user is null)
{
redirectManager.RedirectToWithStatus("Account/InvalidUser", $"Error: Unable to load user with ID '{userManager.GetUserId(context.User)}'.", context);
}
return user;
}
}