mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
Allow login if api is restricted
This commit is contained in:
parent
fc02b652f5
commit
fde33dbc3e
@ -396,12 +396,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
case SUPPORTED_LATEST:
|
case SUPPORTED_LATEST:
|
||||||
case SUPPORTED_OLD:
|
case SUPPORTED_OLD:
|
||||||
case DEVELOPMENT:
|
case DEVELOPMENT:
|
||||||
if(loginType == 1) {
|
login(loginType, instanceUrl, loginUid, loginPass, loginOTP, loginToken_);
|
||||||
letTheUserIn(instanceUrl, loginUid, loginPass, loginOTP);
|
|
||||||
}
|
|
||||||
else if(loginType == 2) { // token
|
|
||||||
letTheUserInViaToken(instanceUrl, loginToken_);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case UNSUPPORTED_OLD:
|
case UNSUPPORTED_OLD:
|
||||||
|
|
||||||
@ -424,12 +419,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if(loginType == 1) {
|
login(loginType, instanceUrl, loginUid, loginPass, loginOTP, loginToken_);
|
||||||
letTheUserIn(instanceUrl, loginUid, loginPass, loginOTP);
|
|
||||||
}
|
|
||||||
else if(loginType == 2) { // token
|
|
||||||
letTheUserInViaToken(instanceUrl, loginToken_);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -445,7 +435,18 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if (responseVersion.code() == 403) {
|
||||||
|
login(loginType, instanceUrl, loginUid, loginPass, loginOTP, loginToken_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void login(int loginType, String instanceUrl, String loginUid, String loginPass, int loginOTP, String loginToken_) {
|
||||||
|
if (loginType == 1) {
|
||||||
|
letTheUserIn(instanceUrl, loginUid, loginPass, loginOTP);
|
||||||
|
}
|
||||||
|
else if (loginType == 2) { // token
|
||||||
|
letTheUserInViaToken(instanceUrl, loginToken_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user