mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
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();
|
||||
return;
|
||||
}
|
||||
if (result.getResponse().getStatus() != 200) {
|
||||
unauthorized.run();
|
||||
if (result.getResponse().getStatus() == 200) {
|
||||
PostSignInResponseModel signInModel = gson.fromJson(getContentAsString(),
|
||||
PostSignInResponseModel.class);
|
||||
if (signInModel == null || signInModel.errorCode != 0 || signInModel.sessionId.equals("")) {
|
||||
unauthorized.run();
|
||||
return;
|
||||
}
|
||||
signInDone.accept(signInModel.sessionId);
|
||||
return;
|
||||
}
|
||||
PostSignInResponseModel signInModel = gson.fromJson(getContentAsString(),
|
||||
PostSignInResponseModel.class);
|
||||
if (signInModel == null || signInModel.errorCode != 0 || signInModel.sessionId.equals("")) {
|
||||
unauthorized.run();
|
||||
return;
|
||||
}
|
||||
signInDone.accept(signInModel.sessionId);
|
||||
|
||||
connectionLosed.run();
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user