1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-14 09:38:16 -05:00
bitwarden/src/Core/Utilities/CurrentContextMiddleware.cs
2022-08-29 16:06:55 -04:00

22 lines
537 B
C#

using Bit.Core.Context;
using Bit.Core.Settings;
using Microsoft.AspNetCore.Http;
namespace Bit.Core.Utilities;
public class CurrentContextMiddleware
{
private readonly RequestDelegate _next;
public CurrentContextMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext httpContext, ICurrentContext currentContext, GlobalSettings globalSettings)
{
await currentContext.BuildAsync(httpContext, globalSettings);
await _next.Invoke(httpContext);
}
}