using Tiku.Application.Security;

namespace Tiku.Api.Middleware;

public sealed class CurrentPrincipalMiddleware(RequestDelegate next)
{
    public async Task InvokeAsync(
        HttpContext context,
        ICurrentUser currentUser)
    {
        currentUser.Load(context.User);
        await next(context);
    }
}