Update Happiness Task
This commit is contained in:
@@ -3,12 +3,20 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization.Policy;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WebAPI.Services;
|
||||
|
||||
public class BasicAuthorizationMiddlewareResultHandler : IAuthorizationMiddlewareResultHandler
|
||||
{
|
||||
private readonly AuthorizationMiddlewareResultHandler defaultHandler = new();
|
||||
private readonly IServiceScopeFactory serviceScopeFactory;
|
||||
|
||||
public BasicAuthorizationMiddlewareResultHandler(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
this.serviceScopeFactory = serviceScopeFactory;
|
||||
}
|
||||
|
||||
public async Task HandleAsync(
|
||||
RequestDelegate next,
|
||||
@@ -33,6 +41,15 @@
|
||||
return;
|
||||
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// using (var scope = serviceScopeFactory.CreateScope())
|
||||
// {
|
||||
// var service = scope.ServiceProvider.GetService<IdentityService>();
|
||||
// service.UserAccessToken =;
|
||||
// }
|
||||
|
||||
//}
|
||||
// Fall back to the default implementation.
|
||||
//await defaultHandler.HandleAsync(next, context, policy, authorizeResult);
|
||||
await next(context);
|
||||
|
||||
Reference in New Issue
Block a user