diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/InboxActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/InboxActivity.java index 3aa8a806..91c7dc66 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/InboxActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/InboxActivity.java @@ -64,7 +64,6 @@ import eu.toldi.infinityforlemmy.utils.Utils; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; -import retrofit2.Retrofit; public class InboxActivity extends BaseActivity implements ActivityToolbarInterface, RecyclerViewContentScrollingInterface { @@ -93,9 +92,6 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf @Named("base") RetrofitHolder mRetrofit; - @Inject - @Named("oauth") - Retrofit mOauthRetrofit; @Inject RedditDataRoomDatabase mRedditDataRoomDatabase; @Inject @@ -307,7 +303,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf } else if (item.getItemId() == R.id.action_read_all_messages_inbox_activity) { if (mAccessToken != null) { Toast.makeText(this, R.string.please_wait, Toast.LENGTH_SHORT).show(); - mOauthRetrofit.create(RedditAPI.class).readAllMessages(APIUtils.getOAuthHeader(mAccessToken)) + mRetrofit.getRetrofit().create(RedditAPI.class).readAllMessages(APIUtils.getOAuthHeader(mAccessToken)) .enqueue(new Callback<>() { @Override public void onResponse(@NonNull Call call, @NonNull Response response) { diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/LoginActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/LoginActivity.java index 5837c41a..39a45c54 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/LoginActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/LoginActivity.java @@ -209,6 +209,7 @@ public class LoginActivity extends BaseActivity { try { String errorBody = response.errorBody().string(); + Log.e("LoginActivity", "Error body: " + errorBody.trim()); JSONObject responseObject = new JSONObject(errorBody.trim()); if (responseObject.has("error")) { if (responseObject.getString("error").equals("incorrect_login")) { @@ -225,7 +226,7 @@ public class LoginActivity extends BaseActivity { Toast.makeText(LoginActivity.this, R.string.cannot_fetch_user_info, Toast.LENGTH_SHORT).show(); } - Log.e("LoginActivity", "Failed to get access token: " + response.code() + " " + response.message() + " " + response.errorBody()); + Log.e("LoginActivity", "Failed to get access token: " + response.code() + " " + response.message()); }