28 lines
531 B
C#
28 lines
531 B
C#
using WorkClub.Api.Services;
|
|
|
|
namespace WorkClub.Api.Middleware;
|
|
|
|
public class MemberSyncMiddleware
|
|
{
|
|
private readonly RequestDelegate _next;
|
|
|
|
public MemberSyncMiddleware(RequestDelegate next)
|
|
{
|
|
//test commit
|
|
_next = next;
|
|
}
|
|
|
|
public async Task InvokeAsync(HttpContext context, MemberSyncService memberSyncService)
|
|
{
|
|
try
|
|
{
|
|
await memberSyncService.EnsureMemberExistsAsync(context);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
|
|
await _next(context);
|
|
}
|
|
}
|