2026-03-03 19:41:01 +01:00
|
|
|
using WorkClub.Api.Services;
|
|
|
|
|
|
|
|
|
|
namespace WorkClub.Api.Middleware;
|
|
|
|
|
|
|
|
|
|
public class MemberSyncMiddleware
|
|
|
|
|
{
|
|
|
|
|
private readonly RequestDelegate _next;
|
|
|
|
|
|
|
|
|
|
public MemberSyncMiddleware(RequestDelegate next)
|
|
|
|
|
{
|
2026-03-08 14:22:56 +01:00
|
|
|
//test commit
|
2026-03-03 19:41:01 +01:00
|
|
|
_next = next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task InvokeAsync(HttpContext context, MemberSyncService memberSyncService)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await memberSyncService.EnsureMemberExistsAsync(context);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _next(context);
|
|
|
|
|
}
|
|
|
|
|
}
|