MyBookmark/Modules.User.Application/UserMiddleware.cs
2024-11-27 03:22:03 +03:00

24 lines
549 B
C#

using Microsoft.AspNetCore.Http;
namespace Modules.User.Application;
public class UserMiddleware
{
private readonly RequestDelegate _next;
public UserMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext httpContext, UserContext userContext)
{
userContext.SetUserInfo(httpContext);
userContext.SetUserAgent(httpContext);
userContext.SetRefreshToken(httpContext);
userContext.SetClientIp(httpContext);
await _next(httpContext);
}
}