Inital project setup

This commit is contained in:
Vincent Allen
2025-07-16 21:34:12 -04:00
commit 84108877d5
288 changed files with 12568 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Identity;
using OpenArchival.Blazor.Data;
namespace OpenArchival.Blazor.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;
}
}
}