Fixing Issue if server returns not 200 while signing in (#12211)
Signed-off-by: EvilPingu <ckittel@gmx.de>
This commit is contained in:
parent
e872e14894
commit
b9a838bf18
|
@ -73,17 +73,19 @@ public class SignInService {
|
||||||
connectionLosed.run();
|
connectionLosed.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result.getResponse().getStatus() != 200) {
|
if (result.getResponse().getStatus() == 200) {
|
||||||
unauthorized.run();
|
PostSignInResponseModel signInModel = gson.fromJson(getContentAsString(),
|
||||||
|
PostSignInResponseModel.class);
|
||||||
|
if (signInModel == null || signInModel.errorCode != 0 || signInModel.sessionId.equals("")) {
|
||||||
|
unauthorized.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
signInDone.accept(signInModel.sessionId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PostSignInResponseModel signInModel = gson.fromJson(getContentAsString(),
|
|
||||||
PostSignInResponseModel.class);
|
connectionLosed.run();
|
||||||
if (signInModel == null || signInModel.errorCode != 0 || signInModel.sessionId.equals("")) {
|
return;
|
||||||
unauthorized.run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
signInDone.accept(signInModel.sessionId);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue