Skip to content

Commit d50de34

Browse files
author
Dean Singh
committed
Added http 401 check
1 parent 6e1bf34 commit d50de34

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

src/com/loopj/android/http/AsyncHttpResponseHandler.java

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,10 @@
2626
import org.apache.http.entity.BufferedHttpEntity;
2727
import org.apache.http.util.EntityUtils;
2828

29-
import android.content.Intent;
3029
import android.os.Handler;
3130
import android.os.Looper;
3231
import android.os.Message;
3332

34-
import com.pose.PoseApp;
35-
import com.pose.SignupSplashActivity;
36-
import com.pose.models.User;
37-
import com.pose.utility.GSGlobals;
38-
3933
/**
4034
* Used to intercept and handle the responses from requests made using
4135
* {@link AsyncHttpClient}. The {@link #onSuccess(String)} method is
@@ -215,7 +209,6 @@ void sendResponseMessage(HttpResponse response)
215209
StatusLine status = response.getStatusLine();
216210
if(status.getStatusCode() >= 300)
217211
{
218-
//sendFailureMessage(new HttpResponseException(status.getStatusCode(), status.getReasonPhrase()));
219212
try
220213
{
221214
HttpEntity entity = null;
@@ -234,20 +227,19 @@ void sendResponseMessage(HttpResponse response)
234227

235228
if(status.getStatusCode() == 401)
236229
{
237-
if (User.isAuthenticated())
238-
{
239-
User.signout(null);
240-
PoseApp.clearDB();
241-
Intent intentSendLogout = new Intent(GSGlobals.INTENT_POSE_LOGOUT);
242-
PoseApp.getContext().sendBroadcast(intentSendLogout);
243-
244-
Intent intent = new Intent(PoseApp.getContext(), SignupSplashActivity.class);
245-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
246-
PoseApp.getContext().startActivity(intent);
247-
}
230+
// if (User.isAuthenticated())
231+
// {
232+
// User.signout(null);
233+
// PoseApp.clearDB();
234+
// Intent intentSendLogout = new Intent(GSGlobals.INTENT_POSE_LOGOUT);
235+
// PoseApp.getContext().sendBroadcast(intentSendLogout);
236+
//
237+
// Intent intent = new Intent(PoseApp.getContext(), SignupSplashActivity.class);
238+
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
239+
// PoseApp.getContext().startActivity(intent);
240+
// }
248241
}
249-
} else
250-
{
242+
} else {
251243
try
252244
{
253245
HttpEntity entity = null;

0 commit comments

Comments
 (0)