feat(infra): register RefreshTokenRepository, RefreshTokenGenerator, ClientContext and handlers in DI

This commit is contained in:
2026-04-14 13:28:36 -03:00
parent cb4250f7b3
commit aed26e3de9
3 changed files with 25 additions and 2 deletions

View File

@@ -2,6 +2,8 @@ using FluentValidation;
using Microsoft.Extensions.DependencyInjection;
using SIGCM2.Application.Abstractions;
using SIGCM2.Application.Auth.Login;
using SIGCM2.Application.Auth.Logout;
using SIGCM2.Application.Auth.Refresh;
namespace SIGCM2.Application;
@@ -9,10 +11,12 @@ public static class DependencyInjection
{
public static IServiceCollection AddApplication(this IServiceCollection services)
{
// Register command handlers
// Command handlers
services.AddScoped<ICommandHandler<LoginCommand, LoginResponseDto>, LoginCommandHandler>();
services.AddScoped<ICommandHandler<RefreshCommand, RefreshResponseDto>, RefreshCommandHandler>();
services.AddScoped<ICommandHandler<LogoutCommand, LogoutResponseDto>, LogoutCommandHandler>();
// Register FluentValidation validators from this assembly
// FluentValidation validators (scans entire Application assembly)
services.AddValidatorsFromAssemblyContaining<LoginCommandValidator>();
return services;