refactor: change Invoke to async

This commit is contained in:
Polianin Nikita 2024-08-12 21:36:07 +03:00
parent b1250616a7
commit 80dc2e412c
3 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ namespace Mirea.Api.Endpoint.Middleware;
public class CustomExceptionHandlerMiddleware(RequestDelegate next) public class CustomExceptionHandlerMiddleware(RequestDelegate next)
{ {
public async Task Invoke(HttpContext context) public async Task InvokeAsync(HttpContext context)
{ {
try try
{ {

View File

@ -6,7 +6,7 @@ namespace Mirea.Api.Endpoint.Middleware;
public class JwtRevocationMiddleware(RequestDelegate next) public class JwtRevocationMiddleware(RequestDelegate next)
{ {
public async Task Invoke(HttpContext context, IRevokedToken revokedTokenStore) public async Task InvokeAsync(HttpContext context, IRevokedToken revokedTokenStore)
{ {
if (context.Request.Headers.ContainsKey("Authorization")) if (context.Request.Headers.ContainsKey("Authorization"))
{ {

View File

@ -13,7 +13,7 @@ public class MaintenanceModeMiddleware(RequestDelegate next, IMaintenanceModeSer
return endpoint?.Metadata.GetMetadata<MaintenanceModeIgnoreAttribute>() != null; return endpoint?.Metadata.GetMetadata<MaintenanceModeIgnoreAttribute>() != null;
} }
public async Task Invoke(HttpContext context) public async Task InvokeAsync(HttpContext context)
{ {
if (!maintenanceModeService.IsMaintenanceMode && !maintenanceModeNotConfigureService.IsMaintenanceMode || IsIgnoreMaintenanceMode(context)) if (!maintenanceModeService.IsMaintenanceMode && !maintenanceModeNotConfigureService.IsMaintenanceMode || IsIgnoreMaintenanceMode(context))
await next(context); await next(context);