Ejemplo n.º 1
0
 //TODO Remove auto login
 private async Task TestLogin()
 {
     using (var client = new AccountClient())
     {
         TokenModel token = await client.Login("*****@*****.**", "Test123;");
         if(token != null)
         {
             Global.Properties.AuthenticationToken = token;
             _logger.Debug(token.ExpiresAt);
             _logger.Debug(Global.Properties.AuthenticationToken.AccessToken);
             _logger.Debug(Global.Properties.AuthenticationToken.ExpiresIn);
         }
     }
 }
 private async void btnLogin_Click(object sender, RoutedEventArgs e)
 {
     TokenModel token = null;
     using (var client = new AccountClient())
     {
         token = await client.Login(txtUsername.Text, txtPassword.Text);
     }
     if(token == null)
     {
         return;
     }
     if (String.IsNullOrWhiteSpace(token.AccessToken))
     {
         return;
     }
     Global.Properties.AuthenticationToken = token;
     this.Close();
 }