protected async Task <IActionResult> HandleSessionRequestAsync <TCommand>(TCommand command)
            where TCommand : class, ISessionCommand
        {
            command.BindRequest(HttpContext);

            await _mediatRBus.SendAsync(command);

            var jwtSession = await _authenticationService.GetJwtSessionAsync(command.SessionId,
                                                                             command.Request.IpAddress, command.Request.UserAgent);

            return(Ok(jwtSession));
        }
        public async Task Handle(SignedUpDomainEvent @event, CancellationToken cancellationToken)
        {
            _logger.LogInformation("----- Handling domain event {DomainEventName} ({@Event})",
                                   @event.GetGenericTypeName(), @event);

            await _mediatRBus.SendAsync(
                new SendActivateAccountMessageCommand(@event.Request, @event.User.Email, @event.User.Username,
                                                      @event.User.Id), cancellationToken);

            await _massTransitBusService.PublishAsync(new SignedUpIntegrationEvent(@event.Request.Id, @event.User.Id,
                                                                                   $"Successfully signed up user with id: {@event.User.Id}.", @event.User.Role, @event.User.State),
                                                      cancellationToken);

            _logger.LogInformation("----- Domain event {DomainEvent} handled", @event.GetGenericTypeName());
        }