Fixing Issue if server returns not 200 while signing in (#12211)

Signed-off-by: EvilPingu <ckittel@gmx.de>
This commit is contained in:
Christian Kittel 2022-02-05 21:21:51 +01:00 committed by GitHub
parent e872e14894
commit b9a838bf18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -73,10 +73,7 @@ public class SignInService {
connectionLosed.run(); connectionLosed.run();
return; return;
} }
if (result.getResponse().getStatus() != 200) { if (result.getResponse().getStatus() == 200) {
unauthorized.run();
return;
}
PostSignInResponseModel signInModel = gson.fromJson(getContentAsString(), PostSignInResponseModel signInModel = gson.fromJson(getContentAsString(),
PostSignInResponseModel.class); PostSignInResponseModel.class);
if (signInModel == null || signInModel.errorCode != 0 || signInModel.sessionId.equals("")) { if (signInModel == null || signInModel.errorCode != 0 || signInModel.sessionId.equals("")) {
@ -84,6 +81,11 @@ public class SignInService {
return; return;
} }
signInDone.accept(signInModel.sessionId); signInDone.accept(signInModel.sessionId);
return;
}
connectionLosed.run();
return;
} }
}); });
} }