mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed EDU-408 Error when trying to upload course to stepic with incorrect credentials
This commit is contained in:
@@ -132,6 +132,7 @@ public class EduStepicConnector {
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e.getMessage());
|
||||
ourClient = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -144,11 +145,13 @@ public class EduStepicConnector {
|
||||
final StatusLine line = response.getStatusLine();
|
||||
if (line.getStatusCode() != 302) {
|
||||
LOG.error("Failed to login " + EntityUtils.toString(response.getEntity()));
|
||||
ourClient = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e.getMessage());
|
||||
LOG.warn(e.getMessage());
|
||||
ourClient = null;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -39,13 +39,15 @@ public class LoginDialog extends DialogWrapper {
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
AuthDataHolder authData = myLoginPanel.getAuthData();
|
||||
StudySettings.getInstance().setLogin(authData.email);
|
||||
StudySettings.getInstance().setPassword(authData.password);
|
||||
final boolean success = EduStepicConnector.login(authData.email, authData.password);
|
||||
if (!success) {
|
||||
setErrorText("Log in failed");
|
||||
setErrorText("Login failed");
|
||||
}
|
||||
else {
|
||||
StudySettings.getInstance().setLogin(authData.email);
|
||||
StudySettings.getInstance().setPassword(authData.password);
|
||||
super.doOKAction();
|
||||
}
|
||||
super.doOKAction();
|
||||
}
|
||||
|
||||
public void clearErrors() {
|
||||
|
||||
Reference in New Issue
Block a user