2024-05-19 23:51:53 +02:00
|
|
|
using Foxchat.Identity.Authorization;
|
|
|
|
|
|
|
|
namespace Foxchat.Identity.Extensions;
|
|
|
|
|
|
|
|
public static class WebApplicationExtensions
|
|
|
|
{
|
2024-05-20 17:00:21 +02:00
|
|
|
public static IServiceCollection AddCustomMiddleware(this IServiceCollection services)
|
|
|
|
{
|
|
|
|
return services
|
|
|
|
.AddScoped<AuthenticationMiddleware>()
|
|
|
|
.AddScoped<AuthorizationMiddleware>();
|
|
|
|
}
|
|
|
|
|
2024-05-19 23:51:53 +02:00
|
|
|
public static IApplicationBuilder UseCustomMiddleware(this IApplicationBuilder app)
|
|
|
|
{
|
|
|
|
return app
|
|
|
|
.UseMiddleware<AuthenticationMiddleware>()
|
|
|
|
.UseMiddleware<AuthorizationMiddleware>();
|
|
|
|
}
|
|
|
|
}
|