Skip to content

Commit f7b1a60

Browse files
committed
rename login function to checkAuth as there is no actual login any more
1 parent 1092484 commit f7b1a60

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

app/src/main/java/org/pyload/android/client/pyLoadApp.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public String verboseBool(boolean state) {
6969
return getString(R.string.off);
7070
}
7171

72-
private boolean login() {
72+
private boolean checkAuth() {
7373
// replace protocol, some user also enter it
7474
String host = prefs.getString("host", "10.0.2.2").replaceFirst("^[a-zA-z]+://", "");
7575
int port = Integer.parseInt(prefs.getString("port", "8000"));
@@ -118,7 +118,7 @@ private boolean login() {
118118
retrofit.converterFactories().remove(0);
119119
apiClient.setAdapterBuilder(retrofit);
120120

121-
boolean loginSuccessful;
121+
boolean authSuccessful;
122122
try {
123123
HttpBasicAuth basic_auth = new HttpBasicAuth();
124124
basic_auth.setCredentials(username, password);
@@ -127,23 +127,23 @@ private boolean login() {
127127
PyLoadRestApi pyLoadRestApi = apiClient.createService(PyLoadRestApi.class);
128128

129129
Response<Map<String, Object>> checkAuth = pyLoadRestApi.apiCheckAuthGet(username, password).execute();
130-
loginSuccessful = checkAuth.isSuccessful();
131-
if (loginSuccessful) {
130+
authSuccessful = checkAuth.isSuccessful();
131+
if (authSuccessful) {
132132
client = pyLoadRestApi;
133133
}
134134
} catch (Exception e) {
135135
throw new RuntimeException(e);
136136
}
137137

138-
return loginSuccessful;
138+
return authSuccessful;
139139
}
140140

141141
public PyLoadRestApi getClient() throws WrongLogin, WrongServer {
142142

143143
if (client == null) {
144144
Log.d("pyLoad", "Creating new Client");
145-
boolean loggedIn = login();
146-
if (!loggedIn) {
145+
boolean authSuccessful = checkAuth();
146+
if (!authSuccessful) {
147147
client = null;
148148
throw new WrongLogin();
149149
}

0 commit comments

Comments
 (0)