Ejemplo n.º 1
0
        private async void HandleSignIn()
        {
            //var login = await http
            //.PostJsonAsync<LoginView>("/api/accounts/authenticate", new Coronassist.Web.Shared.Models.UserDto
            //{
            //    Email = Email,
            //    Password = Password
            //});
            var login = await ApplicationUserRepository.AuthenticateAsync(new Coronassist.Web.Shared.Models.UserDto
            {
                Email    = Email,
                Password = Password
            });

            if (login.IsSuccess)
            {
                State.User = login.ApplicationUser;
                StateHasChanged();
                NavigationManager.NavigateTo("dashboard");
            }
            else
            {
                await SweetAlertMessage.ErrorMessage(Text : "Can't log you in, invalid username or password");
            }
            // System.Console.WriteLine("HandleSignInDone");
        }