private async void AceptFormButton_Click
            (object sender, EventArgs e)
        {
            try {
                var            serviceProvider = DependencyContainer.GetProvider;
                ISigninService s = serviceProvider.GetService <ISigninService>();
                await s.SigninAsync(this.UsernameTextBox.Text, this.PasswordTextBox.Text);

                OpenForm();
            } catch (Exception ex) {
                MetroMessageBox.Show(this, ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        public async Task <Unit> Handle(SigninCommand request, CancellationToken cancellationToken)
        {
            AuthenticationProperties properties = null;

            if (AccountOptions.AllowRememberMe && request.ShouldPersist)
            {
                properties = new AuthenticationProperties
                {
                    IsPersistent = true,
                    IssuedUtc    = DateTimeOffset.UtcNow,
                    ExpiresUtc   = DateTimeOffset.UtcNow + AccountOptions.RememberMeSigninDuration
                };
            }

            await loginService.SigninAsync(
                request.Customer,
                properties,
                IdentityServerConstants.LocalIdentityProvider
                );

            return(Unit.Value);
        }