public StartFlowWithPinTransitionHandler(StartFlowCommand startFlowCommand, StopFlowCommand stopFlowCommand,
                                          IJwtComposer jwtComposer, IIdentitiesProvider identitiesProvider, IUrlProvider urlProvider,
                                          SetPinCommand setPinCommand) : base(startFlowCommand, stopFlowCommand, jwtComposer, identitiesProvider,
                                                                              urlProvider)
 {
     _setPinCommand = setPinCommand;
 }
 public StartFlowTransitionHandler(StartFlowCommand startFlowCommand, StopFlowCommand stopFlowCommand,
                                   IJwtComposer jwtComposer, IIdentitiesProvider identitiesProvider, IUrlProvider urlProvider) : base(
         jwtComposer, stopFlowCommand, urlProvider, false)
 {
     StartFlowCommand   = startFlowCommand;
     IdentitiesProvider = identitiesProvider;
 }
        protected override async Task <ITransitionResult> ExecuteInternalAsync(TransitionInput <StartRequest> input,
                                                                               CacheItem relatedItem)
        {
            var composeInfo = new BaseJwtComposeInfo(input)
            {
                Behavior         = GetNextBehaviorFunc(input, relatedItem),
                IncludeRequester = true
            };

            var wasContinued = CheckIfContinued(input, relatedItem);

            if (!wasContinued)
            {
                relatedItem = await _setPinCommand.ExecuteAsync(input.Context);
            }

            var jwt = JwtComposer.GeneratePinStepJwt(composeInfo, relatedItem.SecurityCode);

            if (!wasContinued)
            {
                await StartFlowCommand.ExecuteAsync(new StartFlowCommand.Input
                {
                    Context                    = input.Context,
                    ResponseJwt                = jwt,
                    CredIdCookieValue          = input.Data.CredId,
                    EncryptionTokenCookieValue = input.Data.EncryptionToken,
                    RecoveryTokenCookieValue   = input.Data.RecoveryToken,
                    RequestToken               = input.RequestToken,
                    ResponseToken              = input.ResponseToken
                });
            }

            return(new JwtContainer
            {
                Jwt = jwt
            });
        }