Skip to content

Commit 87fa1dd

Browse files
feat: fix api call
1 parent bcfb12b commit 87fa1dd

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/plugins/auth/src/android/Authenticator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.net.HttpURLConnection;
99
import java.net.URL;
1010
import java.util.Scanner;
11+
import org.json.JSONObject;
1112

1213
public class Authenticator extends CordovaPlugin {
1314
private static final String TAG = "AcodeAuth";
@@ -134,7 +135,7 @@ private String validateToken(String token) {
134135
conn.setRequestProperty("x-auth-token", token);
135136
conn.setRequestMethod("GET");
136137
conn.setConnectTimeout(5000);
137-
conn.setReadTimeout(5000); // Add read timeout too
138+
conn.setReadTimeout(5000);
138139

139140
int code = conn.getResponseCode();
140141
Log.d(TAG, "Server responded with status code: " + code);

src/plugins/auth/src/android/PluginRetriever.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static void retrieveFilteredPlugins(String token,JSONObject filterState,
3737
url = API_BASE + "/plugin?orderBy=" + value + "&page=" + page + "&limit=" + LIMIT;
3838
}
3939

40-
JSONArray items = fetchJsonArray(token,url);
40+
JSONArray items = fetchJsonArray(url,token);
4141
if (items == null) items = new JSONArray();
4242

4343
filterState.put("nextPage", page + 1);
@@ -74,7 +74,7 @@ public static void retrieveFilteredPlugins(String token,JSONObject filterState,
7474
if (!hasMoreSource) break;
7575

7676
String url = API_BASE + "/plugins?page=" + nextPage + "&limit=" + LIMIT;
77-
JSONArray data = fetchJsonArray(token,url);
77+
JSONArray data = fetchJsonArray(url,token);
7878
nextPage++;
7979
filterState.put("nextPage", nextPage);
8080

0 commit comments

Comments
 (0)