Skip to content

Commit

Permalink
Last commit for HackAmherst
Browse files Browse the repository at this point in the history
  • Loading branch information
sushant10 committed Mar 4, 2018
1 parent dbc9c29 commit 21a00e9
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,26 +333,28 @@ public class UserLoginTask extends AsyncTask<Void, Void, Boolean> {
@Override
protected Boolean doInBackground(Void... params) {
// TODO: attempt authentication against a network service.

/*
HttpClient client = HttpClientBuilder.create().build();
HttpPost post = new HttpPost("http://localhost:8080/api/login");
HttpPost post = new HttpPost("http://ham.sharath.pro/api/login");
// Create some NameValuePair for HttpPost parameters
List<NameValuePair> arguments = new ArrayList<>(2);
arguments.add(new BasicNameValuePair("username", mEmail));
arguments.add(new BasicNameValuePair("password", mPassword));
arguments.add(new BasicNameValuePair("username", "[email protected]"));
arguments.add(new BasicNameValuePair("password", "password"));
try {
post.setEntity(new UrlEncodedFormEntity(arguments));
HttpResponse response = client.execute(post);
if(response.toString().contains("200 OK")) {
return true;
}
}
} catch (IOException e) {
return false;
}
return false;
return false;*/

return true;
}

@Override
Expand Down

0 comments on commit 21a00e9

Please sign in to comment.