Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async static Task<bool> VerifyLogin(string email, string password)
- {
- HttpClient httpClient = new HttpClient();
- JsonObject jsonObject = new JsonObject();
- //vamos a ver la forma de trabajar con texto con json segun el ejemplo de Microsoft y adaprlo a mi codigo segun lo que tenga que enviar
- jsonObject["username"] = JsonValue.CreateStringValue(email);
- jsonObject["password"] = JsonValue.CreateStringValue(password);
- string jsonString = jsonObject.Stringify();
- HttpStringContent httpStringContent = new HttpStringContent(jsonString, Windows.Storage.Streams.UnicodeEncoding.Utf8, "application/json");
- Uri uri = new Uri("http://192.168.1.2/laravelplan/public/api/rest/auth/login");
- HttpResponseMessage response = new HttpResponseMessage();
- try
- {
- response = await httpClient.PostAsync(uri, httpStringContent);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK);
- }
- if (!response.IsSuccessStatusCode)
- {
- //string message = response
- MessageBox.Show(response.Content.ToString(), "Error", MessageBoxButton.OK);
- return false;
- }
- /*
- if (dbUser != null)
- {
- usuarios localUser = GetSecureUserModel(username, password, "",
- GetSaltFromString(dbUser.salt));
- if (dbUser.hash == localUser.hash)
- return dbUser;
- }
- */
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment