public Login_process(string usernaam, string password)
        {
            try
            {
                var request    = new Request();
                var loginModel = new login_request {
                    username = usernaam, password = password
                };

                response = (login_response)request.Execute <login_response>(Rest_API.serverurl + "/api/users/login", loginModel, "POST");

                if (response.status != 200)
                {
                    MaterialMessageBox.Show(response.message);
                }

                if (response.status == 200)
                {
                    login_response login_ = new login_response();
                    login_.id        = response.id;
                    login_.name      = response.name;
                    login_.email     = response.email;
                    login_.username  = response.username;
                    login_.role      = response.role;
                    login_.status    = response.status;
                    login_.message   = response.message;
                    login_.FCM_token = response.FCM_token;
                    user_info.Add(login_);

                    if (response.role == "admin")
                    {
                        //Mainpageadmin UI_Mainpage_admin = new Mainpageadmin();
                        Mainpage_normaal UI_mainpage = new Mainpage_normaal();
                        UI_mainpage.Show();
                    }
                    if (response.role == "normal_user")
                    {
                        //Mainpage UI_mainpage = new Mainpage();
                        Mainpage_normaal UI_mainpage = new Mainpage_normaal();
                        UI_mainpage.Show();
                    }
                }
                return;
            }

            catch (Exception ex)
            {
                string error = ex.ToString();

                MaterialMessageBox.Show(error);
            }
        }
 public override Task <response> login(login_request request, ServerCallContext context)
 {
     if (request.Token == Token)
     {
         return(Task.FromResult(new response
         {
             Status = true,
             Message = Environment.UserName
         }));
     }
     else
     {
         return(Task.FromResult(new response
         {
             Status = false,
             Message = "Authentication was not successful"
         }));
     }
 }
 public override Task <response> process(login_request request, ServerCallContext context)
 {
     if (request.Token == Token)
     {
         _logger.LogInformation("A request for process was sent");
         return(Task.FromResult(new response
         {
             Status = true,
             Message = JsonConvert.SerializeObject(SystemInfo.SystemProcess())
         }));
     }
     else
     {
         return(Task.FromResult(new response
         {
             Status = false,
             Message = "Authentication was not successful"
         }));
     }
 }