12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Linq;
- using System.Reflection;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc.Controllers;
- using Microsoft.AspNetCore.Mvc.Infrastructure;
-
- namespace Luticate2.Auth.Middlewares
- {
- public class LuAuthMiddleware
- {
- private readonly RequestDelegate _next;
- private readonly IActionDescriptorCollectionProvider _actionDescriptorCollectionProvider;
-
- public LuAuthMiddleware(RequestDelegate next, IActionDescriptorCollectionProvider actionDescriptorCollectionProvider)
- {
- _next = next;
- _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
- }
-
- public async Task Invoke(HttpContext context)
- {
- // var items = _actionDescriptorCollectionProvider.ActionDescriptors.Items;
- // var item = items.FirstOrDefault();
- // var actionDescriptor = item as ControllerActionDescriptor;
- // if (actionDescriptor != null)
- // {
- //// actionDescriptor.MethodInfo.GetCustomAttributes()
- // }
- await _next.Invoke(context);
- }
- }
- }
|