TopShelfCustomer/TopShelfCustomer/ViewModels/LoginViewModel.cs
/// <summary>
/// LoginClicked:
///
/// Asynchronous function to handle the Log In button's
/// click event. Calls on Firebase Authentication
/// to Authenticate the User and log into the Application
/// </summary>


Asynchronous function to handle the Log In button's
click event. Calls on Firebase Authentication
to Authenticate the User and log into the Application
Asynchronous function to handle the Log In button ' s click event . Calls on Firebase Authentication to Authenticate the User and log into the Application
private async void LoginClicked () {
                string token = await auth.LoginWithEmailPassword( EmailInput, PasswordInput );
                if ( token != "" ) {
                    ApiHelper apiHelper = new ApiHelper();
                    string sanitizedEmail = EmailInput.Replace( ".", "-" );     
                    IsLoading = true;
                    User user = await apiHelper.GetAsync<User>( "User/GetUserByEmail/" + sanitizedEmail );
                    UserContainer.CurrentUser = user;       
                    App.SetCurrentPage<HomePage>();     
                } else {
                    IsErrorVisible = true;
                }
            }
private async void LoginClicked ( ) { string token = await auth . LoginWithEmailPassword ( EmailInput , PasswordInput ) ; if ( token != " " ) { ApiHelper apiHelper = new ApiHelper ( ) ; string sanitizedEmail = EmailInput . Replace ( " " , " " ) ; IsLoading = true ; User user = await apiHelper . GetAsync < User > ( " " + sanitizedEmail ) ; UserContainer . CurrentUser = user ; App . SetCurrentPage < HomePage > ( ) ; } else { IsErrorVisible = true ; } }
LoginClicked:
LoginClicked :
//Replace '.' with '-' to allow for correct Get call //Set the global user //Redirect to the Home Page