public void AuthorizeUser(Action <JSONObject> onComplete)
{
if (_token == null)
{
_token = GetToken();
}
if (_token == "")
{
String response = "{\"error\": \"no token found\"}";
JSONObject jsonResponse = new JSONObject(response);
jsonResponse.Bake();
onComplete(jsonResponse);
return;
}
if (_userId == null)
{
_userId = GetUserid();
}
if (_userId == "")
{
String response = "{\"error\": \"no userid found\"}";
JSONObject jsonResponse = new JSONObject(response);
jsonResponse.Bake();
onComplete(jsonResponse);
return;
}
POST("user/authorize", new Dictionary <string, string> {
{ "token", _token }, { "uuid", _userId }
}, onComplete);
}