feat(infra): register RefreshTokenRepository, RefreshTokenGenerator, ClientContext and handlers in DI
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user